From c7102e0628f15d4ef7b4ec91d589bc426f5a8d48 Mon Sep 17 00:00:00 2001 From: Peter Date: Mon, 17 Mar 2025 20:26:21 -0400 Subject: [PATCH] incorporate related posts to site --- hugo.toml | 1 + layouts/_default/single.html | 64 +++++++++++++++++++++++++++++++++++ layouts/partials/related.html | 8 +++++ 3 files changed, 73 insertions(+) create mode 100644 layouts/_default/single.html create mode 100644 layouts/partials/related.html diff --git a/hugo.toml b/hugo.toml index f463daa..bfc5f39 100644 --- a/hugo.toml +++ b/hugo.toml @@ -59,6 +59,7 @@ defaultContentLanguage = 'es' name = "código-fuente" weight = 3 url = "https://gitlab.com/putridpete/hugo-website" + icon = "fa-brands fa-gitlab" [[menu.header]] name = "rss" weight = 4 diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..15d41dc --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,64 @@ +{{ define "title"}} +{{ .Title }} | {{ .Site.Params.author.name }} +{{ end }} + +{{ define "main" }} +
+

{{ .Title }}

+ {{ if .Description}} +

{{.Description}}

+ {{ end }} + {{ if .Params.showMetadata | default true }} + + {{ end }} +
+ {{ .Content }} +
+{{ $related := .Site.RegularPages.Related . | first 5 }} +{{ with $related }} +

Leer también:

+
+
+
+ +{{ end }} diff --git a/layouts/partials/related.html b/layouts/partials/related.html new file mode 100644 index 0000000..845e7f2 --- /dev/null +++ b/layouts/partials/related.html @@ -0,0 +1,8 @@ +{{ with site.RegularPages.Related . | first 5 }} +

Related content:

+ +{{ end }}