Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pullrequest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
Binary file added assets/images/og-image-overlay.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
2 changes: 1 addition & 1 deletion hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,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"

markup:
tableOfContents:
Expand Down
5 changes: 3 additions & 2 deletions layouts/_partials/headMeta.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
website
{{- end -}}"
/>
<meta property="og:image" content="{{ .Site.BaseURL }}og-image.jpg" />
<meta property="og:image:type" content="image/jpg" />
{{- $ogImage := (partial "helper/ogImage" .) -}}
<meta property="og:image" content="{{ $ogImage.Permalink }}" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
{{- $isNoIndexPage := or (in .RelPermalink "/privacy/") (in .RelPermalink "/imprint/") (eq .RelPermalink "/404.html") (in .RelPermalink "/404/") -}}
Expand Down
9 changes: 7 additions & 2 deletions layouts/_partials/helper/contentImage.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{ $contentImages := slice }}
{{ $contentImageType := "image" }}
{{ with .Params.content_images }}
{{ range . }}
{{ $imagePath := strings.TrimPrefix "./" . }}
Expand All @@ -7,10 +8,14 @@
{{ end }}
{{ end }}
{{ end }}
{{ if not $contentImages }}
{{ if and (not $contentImages) (eq .Kind "single") }}
{{ $contentImages = slice (resources.Get "images/default.webp") }}
{{ $contentImageType = "single-default" }}
{{ else if not $contentImages }}
{{ $contentImages = slice (resources.Get "images/og-image.jpg") }}
{{ $contentImageType = "content-default" }}
{{ end }}

{{ $firstImage := index $contentImages 0 }}

{{ return dict "image" $firstImage "firstImage" $firstImage "images" $contentImages }}
{{ return dict "image" $firstImage "firstImage" $firstImage "images" $contentImages "contentImageType" $contentImageType }}
13 changes: 13 additions & 0 deletions layouts/_partials/helper/ogImage.html
Comment thread
MoritzWeber0 marked this conversation as resolved.
Resolved
Comment thread
MoritzWeber0 marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- $contentImageData := partial "helper/contentImage" . -}}
{{- $contentImage := $contentImageData.firstImage -}}
{{- if reflect.IsImageResourceProcessable $contentImage -}}
{{- $image := $contentImage.Fill "1200x630 center jpg q85" -}}
{{- if eq $contentImageData.contentImageType "image" -}}
{{- $logo := resources.Get "images/og-image-overlay.jpg" -}}
{{- $overlay := images.Overlay $logo 0 0 -}}
{{- $image = $image | images.Filter $overlay -}}
{{- end -}}
{{- return $image -}}
{{- else -}}
{{- return resources.Get "images/og-image.jpg" -}}
{{- end -}}
2 changes: 1 addition & 1 deletion layouts/_partials/structuredData.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{{ $mainEntity = "FAQPage" }}
{{ end }}

{{ $image := (partial "helper/contentImage" .).firstImage.Permalink }}
{{ $image := (partial "helper/ogImage" .).Permalink }}

<script type="application/ld+json">{
"@context": "https://schema.org",
Expand Down
2 changes: 1 addition & 1 deletion layouts/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{{ $cleanedHTML := .Summary | plainify | transform.XMLEscape | safeHTML }}
<description>{{ $cleanedHTML }}</description>
<pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{- with (partial "helper/contentImage" .).firstImage -}}
{{- with (partial "helper/ogImage" .) -}}
<enclosure url="{{- .Permalink -}}" />
{{- end -}}
</item>
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
publish = "public"

[build.environment]
HUGO_VERSION = "0.164.0"
HUGO_VERSION = "0.168.0"
Loading