Skip to content
Snippets Groups Projects
Unverified Commit 7aea1de2 authored by Alexis BENOIT's avatar Alexis BENOIT Committed by GitHub
Browse files

Ajout d'une option du `title` de la page (#807)

parent 7114d33c
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ params:
plausible: false
seo:
title:
sitename: true
separator: "|"
# DESIGN SYSTEM
......
{{ $seoTitle := .title }}
{{ $seoTitleSeparator := .separator}}
{{ $seoTitleSeparator := .separator }}
{{ $page := i18n "commons.pagination.title" }}
{{if and (not .context.IsHome) (eq .kind "page") }}
{{ with .context.Paginator }}
{{ if or .HasPrev .HasNext }}
{{ $currentPageNumber := .PageNumber}}
{{ $seoTitle = printf "%s %s %s %d" $seoTitle $seoTitleSeparator $page $currentPageNumber }}
{{ end }}
{{ if and (not .context.IsHome) (eq .context.Kind "section") }}
{{ 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
{{- $title := chomp (htmlUnescape .Title) -}}
{{- $seoTitle := htmlUnescape site.Title -}}
{{- $seoTitleSeparator := htmlUnescape site.Params.seo.title.separator -}}
{{- if .Title -}}
{{- $seoTitle = printf "%s %s %s" $title $seoTitleSeparator $seoTitle -}}
{{- if $title -}}
{{- if site.Params.seo.title.sitename }}
{{- $seoTitle = printf "%s %s %s" $title $seoTitleSeparator $seoTitle -}}
{{ else -}}
{{- $seoTitle = $title -}}
{{ end -}}
{{- end -}}
{{- $seoTitle = partial "GetPaginateTitle" ( dict "title" $seoTitle "separator" $seoTitleSeparator "context" .) -}}
{{- $seoTitle = partial "GetPaginateTitle" ( dict "title" $seoTitle "separator" $seoTitleSeparator "context" . ) -}}
{{- $seoDescription := "" -}}
{{- if .Params.meta_description -}}
{{- $seoDescription = partial "PrepareHTML" .Params.meta_description -}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment