Files
tiennm99 714ad2391c feat(theme): multi-section bio + per-link enhancements
Introduces multi-section bio cards and link groups for content organization.
Link buttons now support dict-shape with image, featured, scheduled, rel,
and note attributes. Schema Person flattens sections for SEO. RSS and
single.html templates updated to use new link dict shape.

Enables linktree-style content structuring.
2026-05-15 19:50:49 +07:00

42 lines
1.8 KiB
XML

{{- /* RSS 2.0 feed of [[params.links]].
Only emitted when site.Params.rss is true AND user has removed `RSS`
from disableKinds in their hugo.toml. */ -}}
{{- if site.Params.rss -}}
{{- $name := site.Params.name | default site.Title -}}
{{- $tagline := site.Params.tagline | default "" -}}
{{- $bio := site.Params.bio | default $tagline -}}
{{- $now := now -}}
{{ printf "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ $name | transform.XMLEscape }}{{ with $tagline }} — {{ . | transform.XMLEscape }}{{ end }}</title>
<link>{{ site.BaseURL | absLangURL }}</link>
<description>{{ $bio | transform.XMLEscape }}</description>
<generator>Hugo + Bonsai</generator>
<language>{{ site.Language.LanguageCode | default site.LanguageCode }}</language>
<lastBuildDate>{{ $now.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>
<atom:link href="{{ "index.xml" | absURL }}" rel="self" type="application/rss+xml" />
{{- /* Flatten params.links + params.sections.*.links into a single list. */ -}}
{{- $allLinks := slice -}}
{{- if site.Params.sections -}}
{{- range site.Params.sections -}}
{{- range .links -}}{{- $allLinks = $allLinks | append . -}}{{- end -}}
{{- end -}}
{{- else -}}
{{- $allLinks = site.Params.links -}}
{{- end -}}
{{- range $allLinks }}
<item>
<title>{{ .title | transform.XMLEscape }}</title>
<link>{{ .url }}</link>
<guid isPermaLink="false">bonsai-link-{{ .url }}</guid>
<pubDate>{{ $now.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{- with .description }}
<description>{{ . | transform.XMLEscape }}</description>
{{- end }}
</item>
{{- end }}
</channel>
</rss>
{{- end -}}