Skip to content

Commit a03065d

Browse files
committed
fix: header
1 parent 24c1065 commit a03065d

4 files changed

Lines changed: 15 additions & 5 deletions

File tree

config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ MetaDataFormat = "toml"
1414
# For link previews use image 1200×630px (1.91:1), ideally under 300KB
1515
description = "El blog de quienes dan soporte - Sysarmy"
1616
heroImage = "images/og-image.png"
17+
heroImageWidth = 1200
18+
heroImageHeight = 630
1719
favicon = "images/og-image.png"
1820

1921
# dir name of your blog content (default is `content/posts`).

layouts/partials/head.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1111
<meta
1212
name="description"
13-
content="{{ if .IsHome }}{{ $.Site.Params.Subtitle }}{{ else }}{{ .Summary | plainify }}{{ end }}"
13+
content="{{ if .IsHome }}{{ $.Site.Params.Subtitle | default $.Site.Params.subtitle }}{{ else }}{{ .Summary | plainify }}{{ end }}"
1414
/>
1515
<meta
1616
name="keywords"
17-
content="{{ with .Params.Keywords }}{{ delimit . ", " }}{{ else }}{{ $.Site.Params.Keywords }}{{ end }}"
17+
content="{{ with .Params.Keywords }}{{ delimit . ", " }}{{ else }}{{ $.Site.Params.Keywords | default $.Site.Params.keywords }}{{ end }}"
1818
/>
1919
<meta name="robots" content="noodp" />
2020

layouts/partials/head_og_twitter.html

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{{ end }}
2525

2626
{{ with $description }}<meta name="description" content="{{ . }}">{{ end }}
27-
<meta name="keywords" content="{{ if .Params.Keywords }}{{ delimit .Params.Keywords ", " }}{{ else if isset .Params "tags" }}{{ range .Params.tags }}{{ . }}, {{ end }}{{ else }}{{ $.Site.Params.Keywords }}{{ end }}">
27+
<meta name="keywords" content="{{ if .Params.Keywords }}{{ delimit .Params.Keywords ", " }}{{ else if isset .Params "tags" }}{{ range .Params.tags }}{{ . }}, {{ end }}{{ else }}{{ $.Site.Params.Keywords | default $.Site.Params.keywords }}{{ end }}">
2828

2929
<meta name="author" content="sysarmy">
3030
<meta property="fb:admins" content="ajolo" />
@@ -41,8 +41,9 @@
4141
<meta property="twitter:description" content="{{ .Title }}">
4242
<meta name="description" content="{{ $description }}">
4343
{{ else }}
44-
<meta property="og:title" content="{{ .Site.Title }}{{ with .Site.Params.Subtitle }} — {{ . }}{{ end }}">
45-
<meta property="twitter:title" content="{{ .Site.Title }}">
44+
{{ $subtitle := .Site.Params.Subtitle | default .Site.Params.subtitle }}
45+
<meta property="og:title" content="{{ .Site.Title }}{{ with $subtitle }} — {{ . }}{{ end }}">
46+
<meta property="twitter:title" content="{{ .Site.Title }}{{ with $subtitle }} — {{ . }}{{ end }}">
4647
<meta property="og:type" content="website">
4748
<meta property="og:description" content="{{ $description }}">
4849
<meta property="twitter:description" content="{{ $description }}">
@@ -52,9 +53,16 @@
5253
<meta property="og:url" content="{{ .Permalink }}">
5354
<meta property="og:site_name" content="sysarmy">
5455
<meta property="og:image" content="{{ $ogImage }}">
56+
<meta property="og:image:secure_url" content="{{ $ogImage }}">
57+
{{/* Dimensions only when using default hero image (not post-specific featured/social image) */}}
58+
{{ if not (or .Params.socialImage .Params.featuredImage) }}
59+
{{ with .Site.Params.heroImageWidth }}<meta property="og:image:width" content="{{ . }}">{{ end }}
60+
{{ with .Site.Params.heroImageHeight }}<meta property="og:image:height" content="{{ . }}">{{ end }}
61+
{{ end }}
5562
<meta name="twitter:image" content="{{ $ogImage }}">
5663
<meta name="twitter:image:src" content="{{ $ogImage }}">
5764
<meta property="og:image:alt" content="{{ if .IsPage }}{{ .Title }}{{ else }}{{ .Site.Title }}{{ end }}">
65+
<meta name="twitter:image:alt" content="{{ if .IsPage }}{{ .Title }}{{ else }}{{ .Site.Title }}{{ end }}">
5866

5967
{{ if .Params.tags }}
6068
{{ range .Params.tags }}

static/favicon.png

492 Bytes
Loading

0 commit comments

Comments
 (0)