mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-12-25 18:22:09 +00:00
f271291f49
- Build reply-context from front-matter - Add more activitystreams, portblecontacts, ostatus, etc. metadata to Atom feed. Inspired by Pleroma's feeds.
69 lines
3 KiB
XML
69 lines
3 KiB
XML
{{- $pages := (where site.RegularPages "Section" .Section) -}}
|
|
{{- if .IsHome }}
|
|
{{- $pages = where .Site.RegularPages "Section" "" -}}
|
|
{{ end -}}
|
|
{{- $type := "article" -}}
|
|
{{- $period := "daily" -}}
|
|
{{- if eq .Section "notes" -}}
|
|
{{- $type = "note" -}}
|
|
{{- $period = "hourly" -}}
|
|
{{- end -}}
|
|
{{- $icon_svg := resources.Get "/favicon.svg" | resources.Fingerprint "md5" -}}
|
|
{{- $icon_png := resources.Get "/apple-touch-icon.png" | resources.Fingerprint "md5" -}}
|
|
<?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:media="http://search.yahoo.com/mrss/"
|
|
xmlns:ostatus="http://ostatus.org/schema/1.0"
|
|
xmlns:poco="http://portablecontacts.net/spec/1.0"
|
|
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
|
|
xmlns:thr="http://purl.org/syndication/thread/1.0"
|
|
xml:lang="{{ .Site.LanguageCode }}">
|
|
<title>{{ .Section | humanize}} on {{ .Site.Title }}</title>
|
|
<link rel="self" type="application/atom+xml" href="{{ .Permalink }}atom.xml" />
|
|
<logo>{{ $icon_png.Permalink }}</logo>
|
|
<icon>{{ .Site.Params.icon | absURL }}</icon>
|
|
<subtitle>{{ .Params.Description }}</subtitle>
|
|
<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>Seirdy</poco:preferredUsername>
|
|
<poco:displayName>Seirdy</poco:displayName>
|
|
<name>Rohan Kumar</name>
|
|
<uri>https://seirdy.one/</uri>
|
|
</author>
|
|
<updated>{{ now.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
|
|
<id>{{ .Permalink }}</id>
|
|
{{ range $pages }}
|
|
<entry>
|
|
<title>{{ .Title }}</title>
|
|
<link rel="alternate" type="text/html" href="{{ .Permalink }}" />
|
|
<published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published>
|
|
<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
|
|
<author>
|
|
<name>Rohan Kumar</name>
|
|
<uri>https://seirdy.one/</uri>
|
|
</author>
|
|
<id>{{ .Permalink }}</id>
|
|
<rights>CC-BY-SA 4.0 by Rohan Kumar</rights>
|
|
{{- with .Params.replyURI }}
|
|
<thr:in-reply-to ref="{{ . }}" href="{{ . }}" />
|
|
{{- end -}}
|
|
{{- with .Params.replyAuthorURI }}
|
|
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="{{ . }}"/>
|
|
{{- 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")` "" | safeHTML }}
|
|
</div>
|
|
</content>
|
|
<activity:object-type>http://activitystrea.ms/schema/1.0/{{ $type }}</activity:object-type>
|
|
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
|
</entry>
|
|
{{ end }}
|
|
</feed>
|