aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/_default
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-12-16 20:31:51 -0500
committertdro <tdro@noreply.example.com>2022-12-16 20:31:51 -0500
commita298248eea70d434f421f63256aace027c063ffb (patch)
treedf9e093e5340b459fc57c6b8a521340a63259519 /themes/default/layouts/_default
parentc07cd18abaf9a175b28431a5365e04cd0d223a0c (diff)
downloadcanory-a298248eea70d434f421f63256aace027c063ffb.tar.gz
canory-a298248eea70d434f421f63256aace027c063ffb.tar.bz2
canory-a298248eea70d434f421f63256aace027c063ffb.zip
themes/default/layouts/_default/single: Add related content
Add related configuration. May need to soon optimize the templates..
Diffstat (limited to 'themes/default/layouts/_default')
-rw-r--r--themes/default/layouts/_default/single.html28
1 files changed, 26 insertions, 2 deletions
diff --git a/themes/default/layouts/_default/single.html b/themes/default/layouts/_default/single.html
index a32ae01..d94f514 100644
--- a/themes/default/layouts/_default/single.html
+++ b/themes/default/layouts/_default/single.html
@@ -9,7 +9,7 @@
{{ partial "navigator-middle.html"
(dict
"Title" "Message"
- "Subtitle" "Single"
+ "Subtitle" "Thread"
"Icon" "arrow-left"
"IconLabel" "Back"
"Href" "/"
@@ -20,9 +20,33 @@
<micro-thread>
{{ .Render "summary" }}
+
+ {{- $filteredPages := partial "function-filters-content.html" (.Site.RegularPages.Related .) -}}
+ {{- $related := $filteredPages | first 3 -}}
+
+ {{- with $related -}}
+ <related-content>
+ <footer>
+ <samp>
+ Related Tags
+ {{- with $.Params.tags -}}
+ {{- range $tag := first 1 $.Params.tags -}}
+ {{- $link := print ("tags/" | relURL) ($tag | urlize) "/" }}
+ {{ print "---" " " "[#" $tag "](" $link ")" | markdownify -}}
+ {{- end -}}
+ {{- end -}}
+ </samp>
+ </footer>
+ </related-content>
+
+ {{- range $related -}}
+ {{- .Render "summary" -}}
+ {{- end -}}
+ {{- end -}}
+
</micro-thread>
{{ end }}
{{ define "right" }}
- {{- partial "navigator-right.html" . -}}
+ {{- partial "navigator-right.html" . -}}
{{ end }}