1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-12-25 18:22:09 +00:00
seirdy.one/layouts/_default/list.atom.xml
Rohan Kumar 2badbe2601
Use cache-busting partial instead of Fingerprint
This gives files much smaller fingerprints, and supports caching.
2023-12-08 16:08:40 -08:00

119 lines
5.5 KiB
XML

{{- $pages := (where site.RegularPages "Section" .Section) -}}
{{- $period := "daily" -}}
{{- $title := .Section | humanize -}}
{{- if .IsHome -}}
{{- $title = "All content" -}}
{{- $pages = where .Site.RegularPages "Date" "!=" (time "0001-01-01") -}}
{{- $period = "hourly" -}}
{{- end -}}
{{- if eq .Section "notes" -}}
{{- $period = "hourly" -}}
{{- end -}}
{{- $faviconSvg := partialCached "cache-bust.html" "/favicon.svg" "/favicon.svg" -}}
{{- $image := partialCached "cache-bust.html" "/favicon192.png" "/favicon192.png" -}}
{{- $atomLogo := partial "cache-bust.html" "/atom.svg" -}}
{{- /*rejected http://backend.userland.com/creativeCommonsRssModule, as it's completely redundant with <rights> and rel-license. */ -}}
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed
xmlns="http://www.w3.org/2005/Atom"
xmlns:activity="http://activitystrea.ms/spec/1.0/"
xmlns:admin="http://webns.net/mvcb/"
xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:ostatus="http://ostatus.org/schema/1.0"
xmlns:poco="http://portablecontacts.net/spec/1.0"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:thr="http://purl.org/syndication/thread/1.0"
xmlns:webfeeds="http://webfeeds.org/rss/1.0"
xml:lang="{{ .Site.LanguageCode }}">
<cf:treatAs>list</cf:treatAs>
<cf:listinfo>
<cf:sort
ns="http://www.w3.org/2005/Atom"
element="published" data-type="date" label="Date published" default="true"/>
</cf:listinfo>
<title>{{ $title }} on {{ .Site.Title }}</title>
<subtitle>
{{- if .Params.Description -}}
{{- .Params.Description -}}
{{- else -}}
{{- .Site.Params.Description -}}
{{- end -}}
</subtitle>
<link rel="self" type="application/atom+xml" href="{{ .Permalink }}atom.xml" />
{{ with .Site.Params.Hub -}}
<link rel="hub" href="{{ .Site.Params.Hub }}" />
{{- end }}
<icon>{{ $faviconSvg.Permalink }}</icon>
<webfeeds:icon>{{ $image.Permalink }}</webfeeds:icon>
<webfeeds:cover>{{ $atomLogo.Permalink }}</webfeeds:cover>
<logo>{{ $atomLogo.Permalink }}</logo>
<webfeeds:accentColor>191919</webfeeds:accentColor>
<webfeeds:related layout="card" target="browser" />
<sy:updatePeriod>{{ $period }}</sy:updatePeriod>
<sy:updateFrequency>2</sy:updateFrequency>
<author>
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
<poco:preferredUsername>{{ .Site.Author.name }}</poco:preferredUsername>
<poco:displayName>{{ .Site.Author.nick }}</poco:displayName>
<name>{{ .Site.Author.name }}</name>
<email>{{ .Site.Author.email }}</email>
<uri>https://seirdy.one/</uri>
</author>
<admin:errorReportsTo rdf:resource="mailto:{{ .Site.Author.email }}" />
<rights type="text">Copyright © {{ now.Year }} Rohan Kumar</rights>
<link rel="license" type="application/rdf+xml" href="https://creativecommons.org/licenses/by-sa/4.0/rdf" />
<updated>{{ site.LastChange.UTC.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
<generator uri="https://gohugo.io/" version="{{ .Site.Hugo.Version }}">Hugo {{ .Site.Hugo.Version }}</generator>
<id>{{ .Permalink }}</id>
{{ range $pages -}}
{{- if not .Params.Private -}}
<entry>
<title>{{ .Title }}</title>
<link rel="alternate" type="text/html" href="{{ .Permalink }}" />
<id>{{ .Permalink }}</id>
<published>{{ .Date.UTC.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published>
<updated>{{ .Lastmod.UTC.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
<author><name>{{ .Site.Author.name }}</name><uri>https://seirdy.one/</uri></author>
<rights type="text">Copyright © {{ now.Year }} Rohan Kumar</rights>
<link rel="license" type="application/rdf+xml" href="https://creativecommons.org/licenses/by-sa/4.0/rdf" />
{{- with .Params.replyURI -}}
<thr:in-reply-to ref="{{ . }}" href="{{ . }}" type="text/html" />
<link rel="related" type="text/html" href="{{ . }}" />
{{- end -}}
{{- with .Params.replyAuthorURI -}}
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="{{ . }}"/>
{{- end -}}
{{- $type := "article" -}}
{{- /* TODO: add bookmark type and convert bookmarks to their own post types. */ -}}
{{- if eq .Section "notes" -}}
{{- $type = "note" -}}
{{- end -}}
<activity:object-type>http://activitystrea.ms/schema/1.0/{{ $type }}</activity:object-type>
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
{{- with .Params.image -}}
{{- $image := partial "cache-bust.html" (printf "/p/%s" . ) -}}
{{- end -}}
<media:thumbnail url="{{ $image.Permalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" />
{{ with .Description -}}
<summary type="text">{{ . }}</summary>
{{- end }}
<content type="xhtml" xml:base="{{ .Permalink }}">
<div xmlns="http://www.w3.org/1999/xhtml">
{{- if .Params.replyURI -}}
{{- partial "reply-context" .Params | replaceRE `(?: )?(?:item(type|scope|prop|id|ref)="[^"]*"|class="language-figure")` "" | safeHTML }}
{{- end -}}
{{ partial "processed-content.html" . | replaceRE `(?: )?(?:item(type|scope|prop|id|ref)="[^"]*"|class="language-figure")` "" | replaceRE `<meta content="true" ?/>` "" | safeHTML -}}
</div>
</content>
{{- /* TODO: add application/atom+xml version of comments. */ -}}
<link
rel="replies" type="text/html"
href="{{ .Permalink }}#webmentions"
thr:count="{{ .Page.Scratch.Get "webmentionCount" }}" />
<thr:total>{{ .Page.Scratch.Get "webmentionCount" }}</thr:total>
</entry>
{{ end -}}
{{- end }}
</feed>