feat: convert #hashtags in post content to category links

Adds a markdown-it inline rule that transforms #tag text into
links to /categories/tag/ on-site. Syndication targets (Bluesky,
Mastodon, Bridgy) continue to receive raw #tag text, which their
native facet/hashtag detection handles automatically.

Edge cases handled: headings, hex colors, URL fragments, code
blocks, pure numbers are all excluded from conversion.

Confab-Link: http://localhost:8080/sessions/0ec83454-d346-4329-8aaf-6b12139bf596
This commit is contained in:
Ricardo
2026-03-05 13:46:40 +01:00
parent 0c6229088c
commit 91c0816303
2 changed files with 48 additions and 1 deletions

View File

@@ -330,11 +330,19 @@
@apply text-sm text-surface-600 dark:text-surface-400 flex flex-wrap gap-2 items-center;
}
/* Category tags */
/* Category tags (post metadata pills) */
.p-category {
@apply inline-block px-2 py-0.5 text-xs bg-surface-100 dark:bg-surface-800 text-surface-600 dark:text-surface-300 rounded border border-surface-200 dark:border-surface-700 hover:border-surface-400 dark:hover:border-surface-500 transition-colors;
}
/* Inline hashtags in post content — styled as subtle links, not pills */
.e-content a.hashtag,
.prose a.hashtag {
@apply text-accent-600 dark:text-accent-400 no-underline hover:underline font-medium;
/* Override prose default link styling (no border-bottom, no color shift) */
text-decoration: none;
}
/* Webmention facepile - overlapping avatar display */
.facepile {
@apply flex flex-wrap items-center;