mirror of
https://github.com/rottenwheel/rottentheme.git
synced 2024-11-24 10:32:26 +00:00
Merge pull request #7 from kumitterer/main
fix: ensure default image for og and twitter cards
This commit is contained in:
commit
67d21f427d
1 changed files with 11 additions and 3 deletions
|
@ -7,14 +7,22 @@
|
|||
{{ $style := resources.Get "css/style.css" }}
|
||||
{{ $css := $style | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
|
||||
|
||||
|
||||
{{ $image := "" }}
|
||||
{{ if .Params.image }}
|
||||
{{ $image = .Params.image }}
|
||||
{{ else }}
|
||||
{{ $image = resources.Get "images/rw_profile.jpg" }}
|
||||
{{ end }}
|
||||
|
||||
<meta property="og:title" content="{{ .Title }}">
|
||||
<meta property="og:description" content="{{ .Description }}">
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:url" content="{{ .Permalink }}">
|
||||
<meta property="og:image" content="{{ .Site.BaseURL }}{{ .Params.image }}">
|
||||
<meta property="og:image" content="{{ .Site.BaseURL }}{{ $image }}">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:title" content="{{ .Title }}">
|
||||
<meta name="twitter:description" content="{{ .Description }}">
|
||||
<meta name="twitter:image" content="{{ .Site.BaseURL }}{{ .Params.image }}">
|
||||
<meta name="twitter:image" content="{{ .Site.BaseURL }}{{ $image }}">
|
||||
</head>
|
||||
|
|
Loading…
Reference in a new issue