www

website
git clone ssh://anon@src.dalliard.ch/www
log | files | refs

commit b5ca4bb40b492faa43bfd24834010941601a53bd
parent 5984ed372d0ddab855cb46382fd3250b68d56387
author: nathanael <nathanael@dalliard.ch>
date:   Tue, 21 Oct 2025 08:50:16 +0000

add atom feed

diffstat:
Mconfig/_default/config.toml | 9+++++++++
Mcontent/_index.md | 3+++
Mcontent/log/_index.md | 4+---
Alayouts/home.atom.xml | 18++++++++++++++++++
4 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/config/_default/config.toml b/config/_default/config.toml @@ -4,3 +4,12 @@ disableKinds = ['taxonomy', 'rss'] [frontmatter] date = [":filename", ":default"] + +[outputFormats] +[outputFormats.atom] +mediaType = 'application/atom+xml' +baseName = 'feed' + +[mediaTypes] +[mediaTypes.'application/atom+xml'] +suffixes = ['xml'] diff --git a/content/_index.md b/content/_index.md @@ -1,5 +1,8 @@ --- title: nathanael +outputs: +- html +- atom --- [nathanael](a) swiss minimalist diff --git a/content/log/_index.md b/content/log/_index.md @@ -3,7 +3,5 @@ title: log url: l aliases: - log -outputs: -- html -- rss --- +[subscribe](/feed.xml) diff --git a/layouts/home.atom.xml b/layouts/home.atom.xml @@ -0,0 +1,18 @@ +{{- $pages := where site.RegularPages "Section" "log" -}} +{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\"?>" | safeHTML }} +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>{{- .Permalink -}}</id> + <title>{{ .Title }}</title> + <updated>{{- (index $pages.ByLastmod.Reverse 0).Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML -}}</updated> + <author> + <name>{{- .Title -}}</name> + </author> +{{- range $pages -}} + <entry> + <id>{{- .Permalink -}}</id> + <title>{{ .Title }}</title> + <updated>{{- .Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML -}}</updated> + <content type="html">{{- printf "<![CDATA[%s]]>" .Content | safeHTML -}}</content> + </entry> +{{- end -}} +</feed>