Files
hugo-theme-stack/layouts/partials/data/title.html
T
JimmyandGitHub 9add062300 refactor: centralize pagination logic (#1227)
* refactor: centralize pagination logic into a new helper partial used for page titles and index display

* fix: list.html does not exclude hidden pages

* refactor: Simplify title generation logic
2026-01-25 17:54:13 +01:00

20 lines
495 B
HTML

{{- $pageTitle := .Title -}}
{{- $siteTitle := .Site.Title -}}
{{- $paginator := partial "helper/paginator.html" . -}}
{{- $title := slice -}}
{{- if $pageTitle }}
{{- $title = slice $pageTitle -}}
{{- end -}}
{{- if and $paginator $paginator.HasPrev -}}
<!-- Add page number-->
{{ $title = $title | append (printf "Page %d" $paginator.PageNumber) }}
{{- end -}}
{{- if not .IsPage -}}
{{ $title = $title | append $siteTitle }}
{{- end -}}
{{ return delimit $title " - " }}