Skip to content

Commit 6c1f751

Browse files
fix: SEO timeout
1 parent 5f295a1 commit 6c1f751

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

hugo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ theme = "hugoplate"
99
timeZone = "Europe/Berlin"
1010
# post excerpt
1111
summaryLength = 10 # see https://gohugo.io/content-management/excerpts/
12+
13+
# Timeout settings
14+
[timeout]
15+
template = "120s"
1216
# disable language
1317
disableLanguages = [
1418
] # example: ["fr"] for disable french language. see https://gohugo.io/content-management/multilingual/

layouts/partials/basic-seo.html

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@
1717
<meta property="og:site_name" content="{{ site.Title }}" />
1818

1919
{{- with .Params.image -}}
20-
<meta property="og:image" content="{{ . | absURL }}" />
20+
{{- $imageUrl := . | absURL -}}
21+
{{- if not (hasPrefix . "http") -}}
22+
{{- $resourcePath := strings.TrimPrefix "/" . -}}
23+
{{- with resources.Get $resourcePath -}}
24+
{{- $resized := .Fill "1200x630 q85" -}}
25+
{{- $imageUrl = $resized.Permalink -}}
26+
{{- end -}}
27+
{{- end -}}
28+
<meta property="og:image" content="{{ $imageUrl }}" />
2129
<meta property="og:image:width" content="1200" />
2230
<meta property="og:image:height" content="630" />
2331
{{- end -}}
@@ -28,5 +36,13 @@
2836
<meta name="twitter:title" content="{{ $title }}" />
2937
<meta name="twitter:description" content="{{ $description }}" />
3038
{{- with .Params.image -}}
31-
<meta name="twitter:image" content="{{ . | absURL }}" />
39+
{{- $imageUrl := . | absURL -}}
40+
{{- if not (hasPrefix . "http") -}}
41+
{{- $resourcePath := strings.TrimPrefix "/" . -}}
42+
{{- with resources.Get $resourcePath -}}
43+
{{- $resized := .Fill "1200x630 q85" -}}
44+
{{- $imageUrl = $resized.Permalink -}}
45+
{{- end -}}
46+
{{- end -}}
47+
<meta name="twitter:image" content="{{ $imageUrl }}" />
3248
{{- end -}}

0 commit comments

Comments
 (0)