summaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2024-04-14 14:15:06 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2024-04-14 14:31:40 +0200
commit77b73fceb49bff397dab6badb7df8e821960fe2b (patch)
tree10ca440bc10583504c8c15cba1246df91d8ceb3d /layouts
parent847c2dc3ece0896862ec196636c5acbd89b585c2 (diff)
downloadgohugo-theme-ed-77b73fceb49bff397dab6badb7df8e821960fe2b.tar.gz
Update documentation
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/site-last-mod.html20
1 files changed, 15 insertions, 5 deletions
diff --git a/layouts/partials/site-last-mod.html b/layouts/partials/site-last-mod.html
index 1b422b2..6e25657 100644
--- a/layouts/partials/site-last-mod.html
+++ b/layouts/partials/site-last-mod.html
@@ -1,10 +1,20 @@
-{{- /* The .Site.LastChange was deprecated in Hugo v0.123.0 */ -}}
-{{- /* Use .Site.Lastmod if .Site.Hugo.Version greater than or equal to v0.123.0 */ -}}
-{{- /* Otherwise, use .Site.LastChange */ -}}
+{{- /*
-{{- /* For more see: https://github.com/gohugoio/hugo/releases/tag/v0.123.0 */ -}}
+This partial is used to get the last modification date of the site.
-{{- /* Usage: {{ $siteLastMod := partial "site-last-mod.html" . }} */ -}}
+In Hugo v0.123.0, the .Site.LastChange variable was deprecated in favour of .Site.Lastmod.
+To maintain compatibility with older versions of Hugo, this partial checks the Hugo version.
+If the version is greater than or equal to v0.123.0, it uses .Site.Lastmod.
+Otherwise, it falls back to using .Site.LastChange.
+
+The result is stored in the $siteLastMod variable and returned by the partial.
+
+Usage:
+
+ {{ $siteLastMod := partial "site-last-mod.html" . }}
+
+For more information, see: https://github.com/gohugoio/hugo/releases/tag/v0.123.0
+*/ -}}
{{- $siteLastMod := "" -}}