mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
theme: fix URL fro opengraph #683
This commit is contained in:
parent
490e51b72f
commit
7733deb0e1
1 changed files with 23 additions and 19 deletions
|
@ -1,6 +1,10 @@
|
|||
{{- /* based on Hugo 0.119.0 _internal/opengraph.html but with modified title */}}
|
||||
{{- $format := partial "get-format.hugo" . }}
|
||||
{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }}
|
||||
{{- $basename := "index" }}
|
||||
{{- if eq $outputFormat "searchpage" }}
|
||||
{{- $basename = partial "BaseName.hugo" $format.RelPermalink }}
|
||||
{{- end }}
|
||||
{{- $page := . }}
|
||||
{{- $title := .Title }}
|
||||
{{- if eq $outputFormat "searchpage" }}
|
||||
|
@ -23,7 +27,7 @@
|
|||
<meta property="og:title" content="{{ $title }}">
|
||||
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
|
||||
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
|
||||
<meta property="og:url" content="{{ .Permalink }}">
|
||||
<meta property="og:url" content="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" . "abs" true "basename" $basename) }}">
|
||||
{{- with $.Params.images }}
|
||||
{{- range first 6 . }}
|
||||
<meta property="og:image" content="{{ . | absURL }}">
|
||||
|
|
Loading…
Reference in a new issue