-
Alexis BENOIT authoredAlexis BENOIT authored
GetHeadTitle 850 B
{{ $pageTitle := chomp (htmlUnescape .Title) }}
{{ $siteTitle := htmlUnescape site.Title }}
{{ $separator := htmlUnescape site.Params.seo.title.separator }}
{{ $title := printf "%s %s %s" $pageTitle $separator $siteTitle }}
{{/* PAGE OPTION */}}
{{ $option := "both" }}
{{ if .IsHome }}
{{ $option = site.Params.home.head.title }}
{{ end }}
{{ if eq $option "page" }}
{{ $title = $pageTitle }}
{{ else if eq $option "site" }}
{{ $title = $siteTitle }}
{{ end }}
{{/* PAGINATION */}}
{{ if and (not .IsHome) (eq .Kind "section") }}
{{ with .Paginator }}
{{ if or .HasPrev .HasNext }}
{{ $page_label := i18n "commons.pagination.title" }}
{{ $currentPageNumber := .PageNumber }}
{{ $title = printf "%s %s %s %d" $title $separator $page_label $currentPageNumber }}
{{ end }}
{{ end }}
{{ end }}
{{ return $title }}