fix(meta): opengraph, json-ld and gitinfo
Some checks failed
Deploy workflow / deploy (push) Failing after 22s

This commit is contained in:
Matthieu Bessat 2024-09-15 22:47:52 +02:00
parent eac78b1acf
commit 5d3aaafe35
5 changed files with 48 additions and 20 deletions

View file

@ -5,14 +5,16 @@ title = "L'Étoile de Bethléem"
summaryLength = 22
assetDir = "assets"
minifyOutput = false
enableGitInfo = true
[sitemap]
changefreq = 'weekly'
[params]
dateFmt = "02.01.2006 15:04"
ISO8601 = "2006-01-02T15:04:05-07:00"
[params.contact]
peertube = "https://peertube.iriseden.eu/c/etoiledebethleem/videos"
email = "contact@etoiledebethleem.fr"
@ -20,6 +22,7 @@ dateFmt = "02.01.2006 15:04"
helloasso = "https://www.helloasso.com/associations/l-etoile-de-bethleem-association-des-amis-de-la-chapelle-de-bethleem-d-aubevoye/"
helloasso_adhesion = "https://www.helloasso.com/associations/l-etoile-de-bethleem-association-des-amis-de-la-chapelle-de-bethleem-d-aubevoye/adhesions/2023-2024"
paper_adhesion = "https://static.etoiledebethleem.fr/docs/adhesion_papier_2023-2024_v3.pdf"
[params.socials]
facebook = "https://www.facebook.com/groups/bethleemaubevoye"
instagram = "https://www.instagram.com/etoiledebethleem/"

View file

@ -6,7 +6,7 @@
<div class="cover__back" style="background-image: url('{{ .RelPermalink }}')">
<!-- For now we are not going to show a video -->
<!-- <video playsinline autoplay muted loop> -->
<!-- <source src="https://static.etoiledebethleem.fr/videos/teaser_v5.mp4" type="video/webm"> -->
<!-- <source src="https://static.etoiledebethleem.fr/videos/teaser/md.mp4" type="video/webm"> -->
<!-- </video> -->
</div>
{{ end }}

View file

@ -13,11 +13,12 @@
<link rel="canonical" href="{{ .Permalink }}">
{{ partial "opengraph/include.html" . }}
{{ partial "metas/opengraph.html" . }}
{{- partial "metas/json-ld.html" . -}}
{{ range .AlternativeOutputFormats }}
{{- range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
{{ end }}
{{- end -}}
<link rel="apple-touch-icon" sizes="57x57" href="/icons/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/icons/apple-icon-60x60.png">

View file

@ -0,0 +1,24 @@
{{ if .IsPage }}
{{ if eq .Section "actualites" }}
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "BlogPosting",
"articleSection" : "{{ .Section | title }}",
"name" : "{{ .Title }}",
"headline" : "{{ .Title }}",
"description" : "{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}",
"inLanguage" : "fr-FR",
"author" : "{{ .Params.author }}",
"creator" : "Étoile de Bethléem",
"accountablePerson" : "Étoile de Bethléem",
"datePublished": "{{ .PublishDate.Format $.Site.Params.ISO8601 }}",
"dateModified" : "{{ .Lastmod.Format $.Site.Params.ISO8601 }}",
"url" : "{{ .Permalink }}",
"wordCount" : "{{ .WordCount }}",
"keywords" : [ {{ range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }} ]
}
</script>
{{ end }}
{{ end }}

View file

@ -5,7 +5,7 @@
<meta property="og:title" content="{{ $title }}">
<meta property="og:description" content="{{ $description }}">
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:url" content="{{ .Permalink | absURL }}">
<meta property="og:site_name" content="{{ .Site.Title }}">
<meta property="og:type" content="
{{- if .IsPage -}}
@ -17,28 +17,28 @@
<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 }}
{{ if not .Site.LastChange.IsZero }}
<meta property="og:updated_time" content="{{- .Site.LastChange.Format "2006-01-02T15:04:05-07:00" | safeHTML -}}" />
{{- else -}}
{{ if not .Site.Lastmod.IsZero }}
<meta property="og:updated_time" content="{{- .Site.Lastmod.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 }}
<meta property="og:image" content="{{ $image.permalink }}" />
<meta property="og:image" content="{{ $image.permalink | absURL }}" />
{{- end -}}