1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-12-24 17:52:11 +00:00

Add simple list extensions to atom feed

I use this to instruct feed readers on how to sort items. See
<https://learn.microsoft.com/en-us/previous-versions/windows/desktop/gg427659(v=vs.85)>
This commit is contained in:
Rohan Kumar 2023-12-03 21:53:29 -08:00
parent be791111df
commit 319051e126
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479

View file

@ -16,16 +16,23 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed
xmlns="http://www.w3.org/2005/Atom"
xml:lang="{{ .Site.LanguageCode }}"
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">
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 -}}
@ -79,7 +86,8 @@
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="{{ . }}"/>
{{- end -}}
{{- $type := "article" -}}
{{- if eq .Section "notes" -}}{{ /* TODO: add bookmark type and convert bookmarks to their own post types. */ -}}
{{- /* 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>
@ -99,8 +107,11 @@
{{ 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" }}" />
{{- /* 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 -}}