1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-12-24 01:42:10 +00:00

Add combined Atom feed

This commit is contained in:
Rohan Kumar 2022-06-06 12:16:33 -07:00
parent 1782aeeda6
commit 13a2595482
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
3 changed files with 21 additions and 11 deletions

View file

@ -2,6 +2,7 @@
outputs:
- html
- gemtext
- atom
title: Seirdy's Home
description: "Seirdy's Home: personal website and blog for Rohan Kumar, A.K.A. Seirdy. I write about and develop software to promote user autonomy."
sitemap:

View file

@ -1,11 +1,12 @@
{{- $pages := (where site.RegularPages "Section" .Section) -}}
{{- if .IsHome }}
{{- $pages = .Site.RegularPages -}}
{{ end -}}
{{- $type := "article" -}}
{{- $period := "daily" -}}
{{- $title := .Section | humanize -}}
{{- if .IsHome }}
{{- $title = "All content" -}}
{{- $pages = .Site.RegularPages -}}
{{- $period = "hourly" -}}
{{ end -}}
{{- if eq .Section "notes" -}}
{{- $type = "note" -}}
{{- $period = "hourly" -}}
{{- end -}}
{{- $icon_svg := resources.Get "/favicon.svg" | resources.Fingerprint "md5" -}}
@ -20,7 +21,7 @@
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>
<title>{{ $title }} 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>
@ -62,6 +63,10 @@
{{ partial "processed-content.html" . | replaceRE `(?: )?(?:item(type|scope|prop|id|ref)="[^"]*"|class="language-figure")` "" | safeHTML }}
</div>
</content>
{{- $type := "article" -}}
{{- 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>
</entry>

View file

@ -21,14 +21,18 @@
{{ $webmanifest := resources.Get "/manifest.webmanifest" | resources.ExecuteAsTemplate "manifest.webmanifest" . | resources.Minify | resources.Fingerprint "md5" -}}
{{- printf `<link href="%s" rel="manifest" />` $webmanifest.RelPermalink | safeHTML -}}
<!--Feeds for both notes and posts; posts come first unless we're in the notes section.-->
{{- $isNotes := false -}}
{{- if or (eq .Section "notes") (eq .Title "Notes") -}}
{{- $isNotes = true -}}
<link rel="alternate" type="application/atom+xml" href="{{ site.BaseURL }}notes/atom.xml" title="Notes" />
{{- end }}
<link rel="alternate" type="application/atom+xml" href="{{ site.BaseURL }}atom.xml" title="All content" />
<link rel="alternate" type="application/atom+xml" href="{{ site.BaseURL }}posts/atom.xml" title="Posts" />
{{ if not $isNotes -}}
<link rel="alternate" type="application/atom+xml" href="{{ site.BaseURL }}/notes/atom.xml" title="Notes" />
{{- else if or (eq .Section "posts") (eq .Title "Posts") -}}
<link rel="alternate" type="application/atom+xml" href="{{ site.BaseURL }}posts/atom.xml" title="Posts" />
<link rel="alternate" type="application/atom+xml" href="{{ site.BaseURL }}atom.xml" title="All content" />
<link rel="alternate" type="application/atom+xml" href="{{ site.BaseURL }}notes/atom.xml" title="Notes" />
{{- else -}}
<link rel="alternate" type="application/atom+xml" href="{{ site.BaseURL }}atom.xml" title="All content" />
<link rel="alternate" type="application/atom+xml" href="{{ site.BaseURL }}posts/atom.xml" title="Posts" />
<link rel="alternate" type="application/atom+xml" href="{{ site.BaseURL }}notes/atom.xml" title="Notes" />
{{- end }}
<title>{{ .Title }}{{ if and (lt (len .Title) 54) (ne $canonicalRelPermalink "/") }} - Seirdy{{ end }}</title>
{{ $description := .Site.Params.Description -}}