docs: document post interlinking system in CLAUDE.md
Build & Deploy / build-and-deploy (push) Successful in 1m53s
Build & Deploy / build-and-deploy (push) Successful in 1m53s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -54,6 +54,18 @@ Categories use Obsidian-style path notation (`lang/de`, `tech/programming`). The
|
||||
### Changelog
|
||||
`changelog.njk` — public page at `/changelog/` showing development activity. Uses Alpine.js to fetch commits from the IndieKit server's GitHub endpoint (`/github/api/changelog`). Commits are categorised by commit-message prefix (`feat:` → Features, `fix:` → Fixes, `perf:` → Performance, `a11y:` → Accessibility, `docs:` → Docs, everything else → Other). The server-side categorisation is applied by the postinstall patch `patch-endpoint-github-changelog-categories.mjs` in `indiekit-blog`. Tabs, labels, and colours in `changelog.njk` must stay in sync with that patch.
|
||||
|
||||
### Post interlinking (See Also / Linked From)
|
||||
|
||||
Each post page renders two cross-reference sections via filters in `eleventy.config.js`:
|
||||
|
||||
**See Also** (`post.njk` lines ~132–156) — two sources merged into one list:
|
||||
- `seeAlsoLinks(inputPath, relatedUrls)` filter: reads raw markdown at build time, extracts all internal blog links (`](siteUrl/…)`) plus any explicit `related:` frontmatter URLs. Image links (``) are excluded via negative lookbehind so inline images don't pollute the list.
|
||||
- `sameTargetPosts(posts, targetUrl, currentUrl)` filter: finds other published posts that share the same external target (`repostOf`, `likeOf`, `bookmarkOf`, `inReplyTo`).
|
||||
|
||||
**Linked From** (`post.njk` lines ~159–173) — `backlinksWith(posts, pageUrl)` filter returns posts whose raw source links to the current page.
|
||||
|
||||
**Title fallback:** when a post has no title, the `pathOnly` filter is applied to the URL — it strips the domain and trailing slash, showing just `/articles/foo`. Applied in all three lists.
|
||||
|
||||
### Unfurl shortcode
|
||||
`{% unfurl url %}` generates a rich link preview card with caching. Cache lives in `.cache/unfurl/`. The shortcode is registered from `lib/unfurl-shortcode.js`.
|
||||
|
||||
@@ -202,3 +214,4 @@ GITEA_ORG giersig.eu # Gitea org that owns the repos
|
||||
- **Self-hosted Gitea CI** — replaced GitHub Actions; `act_runner` on FreeBSD (custom `gitea_runner` rc service, `su - git` + `nohup`), sharp built from source with persistent binary cache (`src/build/Release/`), rsync via `deploy` user, syndication webhook via internal jail URL
|
||||
- **Gitea sidebar widget** — `github-repos.njk` renamed to "Gitea"; runtime JS fetches commits/repos/PRs directly from `gitea.giersig.eu` API; build-time data via `_data/githubActivity.js` + `_data/githubRepos.js` (both use Gitea org API). Widget configured via `site.gitea.{url,org,repos}` in `_data/site.js`
|
||||
- **Changelog → Gitea** — `/changelog` page fetches commits directly from Gitea API (both repos), with client-side commit categorisation (feat/fix/docs/chore/refactor); no longer depends on IndieKit's GitHub proxy endpoint
|
||||
- **Post interlinking** — See Also (in-text links + `related:` frontmatter + same-target posts) and Linked From (backlinks); image links excluded from auto-extraction; untitled posts show path-only URL via `pathOnly` filter
|
||||
|
||||
Reference in New Issue
Block a user