fix: metas and opengraph
All checks were successful
Deploy workflow / deploy (push) Successful in 35s

This commit is contained in:
Matthieu Bessat 2024-04-02 10:41:44 +02:00
parent ae2accd6db
commit ac68014559
9 changed files with 15 additions and 28 deletions

View file

@ -29,6 +29,5 @@
{{- end -}}
{{ $title = printf "%s - %s" $title $siteTitle }}
{{ return $title }}

View file

@ -1,6 +1,9 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{- $title := partialCached "data/title" . .RelPermalink -}}
<title>{{ $title }} — {{ .Site.Title }}</title>
{{- $description := partialCached "data/description" . .RelPermalink -}}
<meta name="description" content="{{ $description }}">
@ -8,10 +11,6 @@
<meta name="author" content="{{ . }}">
{{ end }}
{{- $title := partialCached "data/title" . .RelPermalink -}}
<title>{{ $title }} {{ if not .IsHome }}- L'Étoile de Bethléem{{ end }}</title>
<link rel="canonical" href="{{ .Permalink }}">
{{ partial "opengraph/include.html" . }}
@ -38,7 +37,6 @@
<meta name="msapplication-TileImage" content="/icons/ms-icon-144x144.png">
<meta name="theme-color" content="#025E73">
<!-- Note: j'ai galérer à rajouter du scss car en fait y'avait déja une variable $style de définit plus haut... -->
{{ $style := resources.Get "sass/main.scss" | resources.ToCSS | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $style.Permalink }}" integrity="{{ $style.Data.Integrity }}">

View file

@ -32,7 +32,7 @@
{{ else }}
<!-- Type arg is set, check for defaultImage setting -->
{{ $defaultImageSetting := .Context.Site.Params.defaultCoverImage }}
{{ $defaultImageSetting := .Context.Site.Params.defaultImage }}
{{ $result = merge $result (dict "isDefault" true) }}
{{ $result = merge $result (dict "exists" true) }}

View file

@ -17,25 +17,25 @@
<meta property="og:locale" content="{{ .Site.LanguageCode }}">
{{- if .IsPage -}}
{{ if .IsPage }}
<meta property="article:section" content="{{ .Section | title }}" />
{{- range .Params.tags -}}
<meta property="article:tag" content="{{ . }}" />
{{- end -}}
{{- end -}}
{{ end }}
{{- if .IsPage -}}
{{ if .IsPage }}
{{- if not .Date.IsZero -}}
<meta property="article:published_time" content="{{- .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML -}}" />
{{- end -}}
{{- if not .Lastmod.IsZero -}}
<meta property="article:modified_time" content="{{- .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML -}}" />
{{- end -}}
{{- else -}}
{{ else }}
{{ if not .Site.LastChange.IsZero }}
<meta property="og:updated_time" content="{{- .Site.LastChange.Format "2006-01-02T15:04:05-07:00" | safeHTML -}}" />
<meta property="og:updated_time" content="{{- .Site.LastChange.Format "2006-01-02T15:04:05-07:00" | safeHTML -}}" />
{{- end -}}
{{- end -}}
{{ end }}
{{ $image := partial "helpers/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" }}
{{ if $image.exists }}