Skip to content

Commit 24c1065

Browse files
committed
fix: test new changes in header
1 parent 2998ae4 commit 24c1065

4 files changed

Lines changed: 68 additions & 3 deletions

File tree

config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ 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+
favicon = "images/og-image.png"
1718

1819
# dir name of your blog content (default is `content/posts`).
1920
# the list of set content will show up on your index page (baseurl).

layouts/partials/head.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
sizes="144x144"
3838
href="{{ "img/apple-touch-icon-144-precomposed.png" | absURL }}"
3939
/>
40-
<link rel="shortcut icon" href="{{ "img/favicon.png" | absURL }}" />
40+
{{ $favicon := or .Site.Params.favicon "img/favicon.png" }}
41+
<link rel="shortcut icon" href="{{ if hasPrefix $favicon "http" }}{{ $favicon }}{{ else }}{{ $favicon | absURL }}{{ end }}" />
4142

4243
<!-- Fonts -->
4344
<link href="{{ "assets/fonts/Inter-Italic.woff2" | absURL }}" rel="preload" type="font/woff2" as="font" crossorigin="">
@@ -47,8 +48,8 @@
4748
<link href="{{ "assets/fonts/Inter-Bold.woff2" | absURL }}" rel="preload" type="font/woff2" as="font" crossorigin="">
4849
<link href="{{ "assets/fonts/Inter-BoldItalic.woff2" | absURL }}" rel="preload" type="font/woff2" as="font" crossorigin="">
4950

50-
<!-- Open Graph / Twitter Card -->
51-
{{ template "_internal/twitter_cards.html" . }}
51+
<!-- Open Graph / Twitter Card (partial so OG image URL is built correctly with baseURL subpath) -->
52+
{{ partial "head_og_twitter.html" . }}
5253

5354
<!-- RSS | JSON -->
5455
{{ range .AlternativeOutputFormats -}}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{{/* Build absolute image URL explicitly so OG image works with baseURL subpath (e.g. /blog/). */}}
2+
{{ $base := strings.TrimSuffix "/" .Site.BaseURL }}
3+
4+
{{ $ogImage := "" }}
5+
{{ $description := "" }}
6+
7+
{{ if .IsPage }}
8+
{{ with .Description }}{{ $description = . }}{{ end }}
9+
{{ if not $description }}{{ $description = .Summary | plainify | truncate 200 }}{{ end }}
10+
{{ if .Params.socialImage }}
11+
{{ $img := .Params.socialImage }}
12+
{{ $ogImage = cond (hasPrefix $img "http") $img (printf "%s/%s" $base $img) }}
13+
{{ else if .Params.featuredImage }}
14+
{{ $img := .Params.featuredImage }}
15+
{{ $ogImage = cond (hasPrefix $img "http") $img (printf "%s/%s" $base $img) }}
16+
{{ else }}
17+
{{ $img := .Site.Params.heroImage | default "images/og-image.png" }}
18+
{{ $ogImage = cond (hasPrefix $img "http") $img (printf "%s/%s" $base $img) }}
19+
{{ end }}
20+
{{ else }}
21+
{{ $description = .Site.Params.description | default .Site.Params.subtitle | default "El blog de quienes dan soporte - Sysarmy" }}
22+
{{ $img := .Site.Params.heroImage | default "images/og-image.png" }}
23+
{{ $ogImage = cond (hasPrefix $img "http") $img (printf "%s/%s" $base $img) }}
24+
{{ end }}
25+
26+
{{ 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 }}">
28+
29+
<meta name="author" content="sysarmy">
30+
<meta property="fb:admins" content="ajolo" />
31+
<meta name="twitter:card" content="summary_large_image">
32+
<meta name="twitter:site" content="@sysarmy">
33+
<meta name="twitter:creator" content="@sysarmy">
34+
35+
{{ if .IsPage }}
36+
<meta property="og:title" content="El blog de quienes dan soporte - Sysarmy">
37+
<meta property="twitter:title" content="El blog de quienes dan soporte - Sysarmy">
38+
<meta property="og:type" content="article">
39+
<meta property="article:published_time" content="{{ .Date.Format "2006-01-02" }}">
40+
<meta property="og:description" content="{{ .Title }}">
41+
<meta property="twitter:description" content="{{ .Title }}">
42+
<meta name="description" content="{{ $description }}">
43+
{{ else }}
44+
<meta property="og:title" content="{{ .Site.Title }}{{ with .Site.Params.Subtitle }} — {{ . }}{{ end }}">
45+
<meta property="twitter:title" content="{{ .Site.Title }}">
46+
<meta property="og:type" content="website">
47+
<meta property="og:description" content="{{ $description }}">
48+
<meta property="twitter:description" content="{{ $description }}">
49+
<meta name="description" content="{{ $description }}">
50+
{{ end }}
51+
52+
<meta property="og:url" content="{{ .Permalink }}">
53+
<meta property="og:site_name" content="sysarmy">
54+
<meta property="og:image" content="{{ $ogImage }}">
55+
<meta name="twitter:image" content="{{ $ogImage }}">
56+
<meta name="twitter:image:src" content="{{ $ogImage }}">
57+
<meta property="og:image:alt" content="{{ if .IsPage }}{{ .Title }}{{ else }}{{ .Site.Title }}{{ end }}">
58+
59+
{{ if .Params.tags }}
60+
{{ range .Params.tags }}
61+
<meta property="og:tags" content="{{ . }}">
62+
{{ end }}
63+
{{ end }}

static/images/favicon.png

492 Bytes
Loading

0 commit comments

Comments
 (0)