Skip to content

Commit b91be0f

Browse files
committed
fix og image missing
1 parent dd44c41 commit b91be0f

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ FootnoteReturnLinkContents = "↑"
8383
adsensePublisher = "ca-pub-1886683614725279"
8484
googleAnalytics = "UA-154678195-1"
8585

86+
# OG
87+
og_image = "images/mdw.png"
88+
8689
# Comments on github issue
8790
[params.utteranc]
8891
repo = "bmpi-dev/bmpi.dev"

content/money/passive-income-protfolio/202102.zh-cn.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ categories: [
1010
"被动收入投资组合"
1111
]
1212
isCJKLanguage: true
13+
og_image: "https://img.bmpi.dev/28a8c22b-f064-8846-2f58-17f3d9749be2.png"
1314
---
1415

1516
## 重新思考估值策略

themes/hugo-coder/layouts/_default/baseof.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
{{ template "_internal/twitter_cards.html" . }}
2323
{{ template "_internal/opengraph.html" . }}
2424

25+
{{ if .Params.og_image }}
26+
<meta property="og:image" content="{{ .Params.og_image }}" />
27+
{{ else }}
28+
{{ with .Site.Params.og_image }}
29+
<meta name="og:image" content="{{ . }}">{{ end }}
30+
{{ end }}
31+
2532
{{ partial "schema.html" . }}
2633

2734
{{ if .Permalink }}

0 commit comments

Comments
 (0)