You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the /link command to accept a URL instead of a title and
auto-fetch the linked page's <title> as linkTitle. Add a computed
title fallback in eleventyComputed.js that derives "Link: <linkTitle>"
when no explicit title is set.
Copy file name to clipboardExpand all lines: .claude/commands/link.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
---
2
-
argument-hint: [title]
2
+
argument-hint: [url]
3
3
description: Create a new link blog post
4
4
---
5
5
6
6
Create a new link blog post with the following specifications:
7
7
8
-
**Title**: $REMAINING_ARGS (all arguments)
8
+
**URL**: $REMAINING_ARGS (all arguments)
9
9
10
-
If no title is provided, prompt the user for a title interactively.
10
+
If no URL is provided, prompt the user for the URL interactively.
11
11
12
12
**Steps to create the link post:**
13
13
@@ -17,15 +17,15 @@ If no title is provided, prompt the user for a title interactively.
17
17
TZ=America/Phoenix date +"%Y-%m-%d %H:%M:%S -07:00"
18
18
```
19
19
20
-
2. If no title was provided, ask the user: "What is the title for this link post?"
20
+
2. If no URL was provided, ask the user: "What is the URL for this link?"
21
21
22
-
3.Ask the user: "What is the URL for this link?"
22
+
3.Fetch the linked page using `WebFetch` and extract the `<title>` tag content. This becomes the `linkTitle`. Clean up the title by trimming whitespace and removing any site name suffixes after common separators like ` | `, ` - `, ` — `, or ` · ` (only remove the last such segment if it looks like a site name, i.e., 3 words or fewer).
23
23
24
24
4. Ask the user: "Do you have a via URL?" (optional — the URL where you found the link, e.g., Hacker News, a blog, etc.)
25
25
26
26
5. Ask the user: "Do you have a blockquote to include?" (optional — a quote from the linked article to include in the post body)
27
27
28
-
6. Generate a slugified directory name from the title:
28
+
6. Generate a slugified directory name from the `linkTitle`:
29
29
30
30
- Aim for around 5 words maximum - remove filler words like "a", "the", "to", "for", "using", "how"
31
31
- Focus on the core concepts and key terms
@@ -51,7 +51,7 @@ If no title is provided, prompt the user for a title interactively.
51
51
- article
52
52
- link
53
53
author: eric
54
-
title: <user-provided title>
54
+
linkTitle: <fetched page title>
55
55
date: <datetime from step 1>
56
56
linkUrl: <user-provided URL>
57
57
viaUrl: <user-provided via URL>
@@ -63,6 +63,9 @@ If no title is provided, prompt the user for a title interactively.
63
63
64
64
Note: Only include the `viaUrl` field if the user provided a via URL.
65
65
66
+
Note: Do NOT include a `title` field — it will be computed automatically
67
+
from `linkTitle` by the data cascade in `www/_data/eleventyComputed.js`.
68
+
66
69
11. After the frontmatter, add the post body:
67
70
68
71
- If the user provided a blockquote, include it as a markdown blockquote (prefixed with `> `)
@@ -82,5 +85,6 @@ If no title is provided, prompt the user for a title interactively.
82
85
- Always use the `-07:00` timezone offset
83
86
- Tags (`article` and `link`) MUST be included in the frontmatter
84
87
- Do NOT include `layout` in the frontmatter — it is provided by the data cascade in `www/links/links.json`
88
+
- Do NOT include `title` in the frontmatter — it is computed from `linkTitle` by `www/_data/eleventyComputed.js`
85
89
- The `linkUrl` field is required and should be a full URL (e.g., `https://example.com/article`)
86
90
- The `viaUrl` field is optional and should be a full URL if provided
0 commit comments