From eae15ff2fc37cc4f24d0a35ae8129e9480ec6a68 Mon Sep 17 00:00:00 2001 From: danix Date: Tue, 7 Mar 2023 15:40:23 +0100 Subject: [PATCH] initial setup of related content inside single articles. Needs working. --- layouts/partials/funcs/related.html | 36 +++++++++++++++++++++++++++++ layouts/post/single-baseof.html | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 layouts/partials/funcs/related.html diff --git a/layouts/partials/funcs/related.html b/layouts/partials/funcs/related.html new file mode 100644 index 0000000..94d2fca --- /dev/null +++ b/layouts/partials/funcs/related.html @@ -0,0 +1,36 @@ +{{ $related := .Site.RegularPages.Related . | first 5 }} +{{ with $related }} +

You might also be interested in:

+ +{{ else }} +

Check out these awesome articles:

+ +{{ end }} \ No newline at end of file diff --git a/layouts/post/single-baseof.html b/layouts/post/single-baseof.html index d75dd0f..c6f8bb9 100644 --- a/layouts/post/single-baseof.html +++ b/layouts/post/single-baseof.html @@ -28,7 +28,7 @@ {{- block "article-main" . }}{{- end }}
-
articoli correlati
+ {{- partial "funcs/related.html" . -}}
{{- partial "footer.html" . -}} -- 2.20.1