fix: metas and opengraph

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

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 }}