aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-10-20 22:05:41 -0400
committertdro <tdro@noreply.example.com>2022-10-20 22:05:41 -0400
commitf804191de73059f7112764af0b8c625d06fec61a (patch)
tree79e96feac4c3db35b22ae6451a2e4eb0f6f00d54
parent5537b61e597dba47b5cd69c28268612e7eb6deb5 (diff)
downloadcanory-f804191de73059f7112764af0b8c625d06fec61a.tar.gz
canory-f804191de73059f7112764af0b8c625d06fec61a.tar.bz2
canory-f804191de73059f7112764af0b8c625d06fec61a.zip
themes/default/layouts/partials/web-ring: Avoid extra markup with feed function return
-rw-r--r--assets/css/default.css4
-rw-r--r--themes/default/layouts/_default/feeds.html2
-rw-r--r--themes/default/layouts/partials/function-generate-feeds.html (renamed from themes/default/layouts/partials/generate-feeds.html)40
-rw-r--r--themes/default/layouts/partials/web-ring.html38
4 files changed, 41 insertions, 43 deletions
diff --git a/assets/css/default.css b/assets/css/default.css
index 3f5ca32..d51613e 100644
--- a/assets/css/default.css
+++ b/assets/css/default.css
@@ -1484,10 +1484,6 @@ gallery-overlay {
border-color: var(--border-darker);
}
-main web-ring {
- display: none;
-}
-
web-ring {
border-radius: 1rem;
position: sticky;
diff --git a/themes/default/layouts/_default/feeds.html b/themes/default/layouts/_default/feeds.html
index 71e6328..2845ea0 100644
--- a/themes/default/layouts/_default/feeds.html
+++ b/themes/default/layouts/_default/feeds.html
@@ -41,7 +41,7 @@
{{ partial "pagination.html" . }}
- {{ partial "generate-feeds" . }}
+ {{ $writeToFile := partial "function-generate-feeds" . }}
{{ end }}
diff --git a/themes/default/layouts/partials/generate-feeds.html b/themes/default/layouts/partials/function-generate-feeds.html
index a6cd906..e494596 100644
--- a/themes/default/layouts/partials/generate-feeds.html
+++ b/themes/default/layouts/partials/function-generate-feeds.html
@@ -242,41 +242,7 @@
$template
-}}
{{- $writeToFile := $markdown.Permalink -}}
- {{ end }}
-
- <web-ring>
- <h1>Web Ring</h1>
- <aside>
- {{ range first 3 (uniq (sort $feeds "FeedDateTime" "desc")) }}
- <web-ring-item>
- <header>
- <a
- title="{{ .FeedLink }}"
- href="{{ .FeedLink }}">
- {{ .FeedTitle }}
- </a>
- </header>
- <time
- title="{{ .FeedDateTitle }}"
- datetime="{{ .FeedDateTime }}">
- {{ .FeedDate }}
- </time>
- <p>
- {{ "--" | markdownify }}
- {{ if gt (len .FeedDescriptionShort) (len .FeedContentShort) -}}
- {{ or .FeedDescriptionShort .FeedTitle }}
- {{- else -}}
- {{ or .FeedContentShort .FeedTitle }}
- {{- end }}
- &mdash;
- </p>
- <a
- title="{{ .FeedSourceDescription }}"
- href="{{ or .FeedSourceHome .FeedSourceLink }}">
- {{ .FeedSourceTitle }}
- </a>
- </web-ring-item>
- {{ end }}
- </aside>
- </web-ring>
+ {{- end -}}
{{- end -}}
+
+{{- return $feeds -}}
diff --git a/themes/default/layouts/partials/web-ring.html b/themes/default/layouts/partials/web-ring.html
index c3d73b4..8228fbd 100644
--- a/themes/default/layouts/partials/web-ring.html
+++ b/themes/default/layouts/partials/web-ring.html
@@ -1 +1,37 @@
-{{ partial "generate-feeds" . }}
+{{- $feeds := partial "function-generate-feeds.html" . -}}
+
+<web-ring>
+ <h1>Web Ring</h1>
+ <aside>
+ {{ range first 3 (uniq (sort $feeds "FeedDateTime" "desc")) }}
+ <web-ring-item>
+ <header>
+ <a
+ title="{{ .FeedLink }}"
+ href="{{ .FeedLink }}">
+ {{ .FeedTitle }}
+ </a>
+ </header>
+ <time
+ title="{{ .FeedDateTitle }}"
+ datetime="{{ .FeedDateTime }}">
+ {{ .FeedDate }}
+ </time>
+ <p>
+ {{ "--" | markdownify }}
+ {{ if gt (len .FeedDescriptionShort) (len .FeedContentShort) -}}
+ {{ or .FeedDescriptionShort .FeedTitle }}
+ {{- else -}}
+ {{ or .FeedContentShort .FeedTitle }}
+ {{- end }}
+ &mdash;
+ </p>
+ <a
+ title="{{ .FeedSourceDescription }}"
+ href="{{ or .FeedSourceHome .FeedSourceLink }}">
+ {{ .FeedSourceTitle }}
+ </a>
+ </web-ring-item>
+ {{ end }}
+ </aside>
+</web-ring>