From 41106cc9fd0a96b9b813d9bf1707b163bdf18939 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Tue, 28 Nov 2023 19:45:12 -0800 Subject: [PATCH] Add comment-count to atom feed, better varnames --- layouts/_default/list.atom.xml | 14 ++++++++------ layouts/partials/webmentions/webmentions.html | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml index 5e96b25..e0dcbe4 100644 --- a/layouts/_default/list.atom.xml +++ b/layouts/_default/list.atom.xml @@ -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" -}} @@ -34,10 +35,10 @@ {{- end -}} - {{ $icon.Permalink }} - {{ $icon.Permalink }} - {{ $logo.Permalink }} - {{ $logo.Permalink }} + {{ $faviconSvg.Permalink }} + {{ $image.Permalink }} + {{ $atomLogo.Permalink }} + {{ $atomLogo.Permalink }} 191919 {{ $period }} 2 @@ -90,6 +91,7 @@ {{ partial "processed-content.html" . | replaceRE `(?: )?(?:item(type|scope|prop|id|ref)="[^"]*"|class="language-figure")` "" | replaceRE `` "" | safeHTML -}} + {{ .Page.Scratch.Get "webmentionCount" }} {{ end -}} {{- end }} diff --git a/layouts/partials/webmentions/webmentions.html b/layouts/partials/webmentions/webmentions.html index e857950..45eedca 100644 --- a/layouts/partials/webmentions/webmentions.html +++ b/layouts/partials/webmentions/webmentions.html @@ -25,6 +25,7 @@ {{- end -}} {{- /* Render webmentions if they exist */ -}} {{- $count := (len $webmentions) -}} +{{- .Page.Scratch.Set "webmentionCount" $count -}} {{- if gt $count 0 -}}
Toggle {{ $count }} Webmentions