diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 996023984..224587cf9 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -32,7 +32,7 @@ jobs: build: runs-on: ubuntu-latest env: - HUGO_VERSION: 0.164.0 + HUGO_VERSION: 0.168.0 steps: - name: Install Hugo CLI run: | diff --git a/.github/workflows/pullrequest.yaml b/.github/workflows/pullrequest.yaml index ce188720b..bbc4b66bf 100644 --- a/.github/workflows/pullrequest.yaml +++ b/.github/workflows/pullrequest.yaml @@ -26,7 +26,7 @@ jobs: build: runs-on: ubuntu-latest env: - HUGO_VERSION: 0.164.0 + HUGO_VERSION: 0.168.0 steps: - name: Install Hugo CLI run: | diff --git a/assets/images/og-image-overlay.jpg b/assets/images/og-image-overlay.jpg new file mode 100644 index 000000000..9542ce0d6 Binary files /dev/null and b/assets/images/og-image-overlay.jpg differ diff --git a/hugo.yaml b/hugo.yaml index 167593e8d..3b8e8bb7e 100644 --- a/hugo.yaml +++ b/hugo.yaml @@ -36,7 +36,7 @@ module: - source: "node_modules/@material-symbols/svg-700/rounded" target: "static/icons/material-symbols-rounded" hugoVersion: - min: "0.164.0" + min: "0.168.0" related: includeNewer: true diff --git a/layouts/_partials/headMeta.html b/layouts/_partials/headMeta.html index 8724dd825..f19587c6f 100644 --- a/layouts/_partials/headMeta.html +++ b/layouts/_partials/headMeta.html @@ -33,8 +33,9 @@ website {{- end -}}" /> - - +{{- $ogImage := (partial "helper/ogImage" .) -}} + + {{- $isNoIndexPage := or (in .RelPermalink "/privacy/") (in .RelPermalink "/imprint/") (eq .RelPermalink "/404.html") (in .RelPermalink "/404/") -}} diff --git a/layouts/_partials/helper/ogImage.html b/layouts/_partials/helper/ogImage.html new file mode 100644 index 000000000..1e68b5f10 --- /dev/null +++ b/layouts/_partials/helper/ogImage.html @@ -0,0 +1,18 @@ +{{- $contentImage := (partial "helper/contentImage" .).firstImage -}} +{{- if reflect.IsImageResourceProcessable $contentImage -}} + {{- $image := $contentImage.Fill "1200x630 center jpg q85" -}} + {{- $logo := resources.Get "images/og-image-overlay.jpg" -}} + {{- $overlay := images.Overlay $logo 0 540 -}} + {{- $title := truncate 35 .Title -}} + {{- $text := images.Text $title (dict + "color" "#000000" + "size" 48 + "x" 15 + "y" 556 + ) + -}} + {{- $image := $image | images.Filter $overlay | images.Filter $text -}} + {{- return $image -}} +{{- else -}} + {{- return "{{ .Site.BaseURL }}og-image.jpg" -}} +{{- end -}} diff --git a/layouts/_partials/structuredData.html b/layouts/_partials/structuredData.html index 9a1e5eb1f..583b4b894 100644 --- a/layouts/_partials/structuredData.html +++ b/layouts/_partials/structuredData.html @@ -12,7 +12,7 @@ {{ $mainEntity = "FAQPage" }} {{ end }} -{{ $image := (partial "helper/contentImage" .).firstImage.Permalink }} +{{ $image := (partial "helper/ogImage" .).Permalink }}