diff --git a/i18n/en.yml b/i18n/en.yml index f2b298f34238880752baaf38bc7a5126997fec85..56550f95089d4b38428c219ef194d758e6c12ddb 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -101,6 +101,7 @@ commons: between: pages: Pages navigation posts: Posts navigation + title: Page pdf: PDF pdf_with_size: PDF ({{ .Size }}) read: Read diff --git a/i18n/fr.yml b/i18n/fr.yml index a2e5e2d74fb0eab09f3ec407c3e674472833fd98..80833e3df562e7a5d293b857dfb8c8290ca631fd 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -101,6 +101,7 @@ commons: between: pages: Navigation entre pages posts: Navigation entre articles + title: Page pdf: PDF pdf_with_size: PDF ({{ .Size }}) read: Lire diff --git a/layouts/partials/GetPaginateTitle b/layouts/partials/GetPaginateTitle new file mode 100644 index 0000000000000000000000000000000000000000..abcc7c46b668c438479cde93c50975611734d203 --- /dev/null +++ b/layouts/partials/GetPaginateTitle @@ -0,0 +1,14 @@ +{{ $seoTitle := .title }} +{{ $seoTitleSeparator := .separator}} +{{ $page := i18n "commons.pagination.title" }} + +{{if not .context.IsHome }} + {{ with .context.Paginator }} + {{ if or .HasPrev .HasNext }} + {{ $currentPageNumber := .PageNumber}} + {{ $seoTitle = printf "%s %s %s %d" $seoTitle $seoTitleSeparator $page $currentPageNumber }} + {{ end }} + {{ end }} +{{ end }} + +{{ return $seoTitle }} \ No newline at end of file diff --git a/layouts/partials/head/seo.html b/layouts/partials/head/seo.html index 25a18d98472a768aa5eeee4147e413ef81ceeb29..138b9262b0a8b33c16b2ee9aba35fe63c002192e 100644 --- a/layouts/partials/head/seo.html +++ b/layouts/partials/head/seo.html @@ -4,6 +4,7 @@ {{- if .Title -}} {{- $seoTitle = printf "%s %s %s" $title $seoTitleSeparator $seoTitle -}} {{- end -}} +{{- $seoTitle = partial "GetPaginateTitle" ( dict "title" $seoTitle "separator" $seoTitleSeparator "context" .) -}} {{- $seoDescription := "" -}} {{- if .Params.meta_description -}} {{- $seoDescription = partial "PrepareHTML" .Params.meta_description -}}