diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 80cd35b..9c0eb20 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -6,6 +6,17 @@ {{ $newsletterEnabled := site.Params.footer.newsletter.enable | default true }} {{ $credentialsEnabled := site.Params.footer.credentials.enable | default true }} {{ $disclaimerEnabled := site.Params.footer.disclaimer.enable | default false }} +{{ $tohaVersion := "v4" }} + +{{- $goModContent := readFile "go.mod" -}} +{{- $lines := split $goModContent "\n" -}} +{{- range $lines -}} + {{- $line := trim . " " -}} + {{- if hasPrefix $line "require github.com/hugo-toha/toha/v4" -}} + {{- $parts := split $line " " -}} + {{- $tohaVersion = index $parts 2 -}} + {{- end -}} +{{- end -}} {{/* Keep backward compatibility for the newsletter function */}} {{ if site.Params.newsletter }} @@ -197,7 +208,7 @@
Toha Theme Logo - Toha + Toha theme {{ $tohaVersion }}
{{ replace $copyrightNotice "{year}" now.Year | markdownify }}