mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-12-24 01:42:10 +00:00
Add comment-count to atom feed, better varnames
This commit is contained in:
parent
9ae8d87908
commit
41106cc9fd
2 changed files with 9 additions and 6 deletions
|
@ -9,9 +9,9 @@
|
|||
{{- if eq .Section "notes" -}}
|
||||
{{- $period = "hourly" -}}
|
||||
{{- end -}}
|
||||
{{- $icon := resources.Get "/favicon.svg" | resources.Fingerprint "md5" -}}
|
||||
{{- $faviconSvg := resources.Get "/favicon.svg" | resources.Fingerprint "md5" -}}
|
||||
{{- $image := resources.Get "/favicon192.png" | resources.Fingerprint "md5" -}}
|
||||
{{- $logo := resources.Get "/atom.svg" | resources.Fingerprint "md5" -}}
|
||||
{{- $atomLogo := resources.Get "/atom.svg" | resources.Fingerprint "md5" -}}
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<feed
|
||||
xmlns="http://www.w3.org/2005/Atom"
|
||||
|
@ -22,6 +22,7 @@
|
|||
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:slash="http://purl.org/rss/1.0/modules/slash/"
|
||||
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">
|
||||
|
@ -34,10 +35,10 @@
|
|||
{{- end -}}
|
||||
</subtitle>
|
||||
<link rel="self" type="application/atom+xml" href="{{ .Permalink }}atom.xml" />
|
||||
<icon>{{ $icon.Permalink }}</icon>
|
||||
<webfeeds:icon>{{ $icon.Permalink }}</webfeeds:icon>
|
||||
<webfeeds:cover>{{ $logo.Permalink }}</webfeeds:cover>
|
||||
<logo>{{ $logo.Permalink }}</logo>
|
||||
<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>
|
||||
<sy:updatePeriod>{{ $period }}</sy:updatePeriod>
|
||||
<sy:updateFrequency>2</sy:updateFrequency>
|
||||
|
@ -90,6 +91,7 @@
|
|||
{{ partial "processed-content.html" . | replaceRE `(?: )?(?:item(type|scope|prop|id|ref)="[^"]*"|class="language-figure")` "" | replaceRE `<meta content="true" ?/>` "" | safeHTML -}}
|
||||
</div>
|
||||
</content>
|
||||
<slash:comments>{{ .Page.Scratch.Get "webmentionCount" }}</slash:comments>
|
||||
</entry>
|
||||
{{ end -}}
|
||||
{{- end }}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
{{- end -}}
|
||||
{{- /* Render webmentions if they exist */ -}}
|
||||
{{- $count := (len $webmentions) -}}
|
||||
{{- .Page.Scratch.Set "webmentionCount" $count -}}<!--For use in atom feed-->
|
||||
{{- if gt $count 0 -}}
|
||||
<details>
|
||||
<summary>Toggle {{ $count }} Webmentions</summary>
|
||||
|
|
Loading…
Reference in a new issue