mirror of
https://github.com/tiennm99/bonsai.git
synced 2026-09-05 18:16:20 +00:00
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.
42 lines
1.8 KiB
XML
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 -}}
|