mirror of
https://github.com/jbowdre/runtimeterror.git
synced 2024-11-22 23:12:19 +00:00
further opengraph tweaks
This commit is contained in:
parent
74cfda7f25
commit
7d162f7295
1 changed files with 5 additions and 7 deletions
|
@ -6,7 +6,6 @@
|
||||||
<meta property="og:url" content="{{ .Permalink }}" />
|
<meta property="og:url" content="{{ .Permalink }}" />
|
||||||
<meta property="og:locale" content="{{ .Lang }}" />
|
<meta property="og:locale" content="{{ .Lang }}" />
|
||||||
{{- if .IsHome }}
|
{{- if .IsHome }}
|
||||||
<meta property="og:type" content="website">
|
|
||||||
{{ $img := $base.Filter (images.Text .Site.Params.Description (dict
|
{{ $img := $base.Filter (images.Text .Site.Params.Description (dict
|
||||||
"color" "#d8d8d8"
|
"color" "#d8d8d8"
|
||||||
"size" 64
|
"size" 64
|
||||||
|
@ -16,11 +15,10 @@
|
||||||
"font" $font
|
"font" $font
|
||||||
))}}
|
))}}
|
||||||
{{ $img = resources.Copy "og.png" $img }}
|
{{ $img = resources.Copy "og.png" $img }}
|
||||||
<meta property="og:image" content="{{$img.Permalink}}" />
|
{{ .Scratch.Set "og_image" $img }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- if .IsPage }}
|
{{- if .IsPage }}
|
||||||
<meta property="og:type" content="article">
|
|
||||||
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
||||||
<meta property="article:section" content="{{ .Section }}" />
|
<meta property="article:section" content="{{ .Section }}" />
|
||||||
{{ with .PublishDate }}<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
|
{{ with .PublishDate }}<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
|
||||||
|
@ -34,19 +32,19 @@
|
||||||
"font" $font
|
"font" $font
|
||||||
))}}
|
))}}
|
||||||
{{ $img = resources.Copy (path.Join .Page.RelPermalink "og.png") $img }}
|
{{ $img = resources.Copy (path.Join .Page.RelPermalink "og.png") $img }}
|
||||||
|
{{ .Scratch.Set "og_image" $img }}
|
||||||
|
{{- end -}}
|
||||||
|
{{ $img := .Scratch.Get "og_image" }}
|
||||||
|
|
||||||
<meta property="og:image" content="{{$img.Permalink}}">
|
<meta property="og:image" content="{{$img.Permalink}}">
|
||||||
<meta property="og:image:width" content="{{$img.Width}}" />
|
<meta property="og:image:width" content="{{$img.Width}}" />
|
||||||
<meta property="og:image:height" content="{{$img.Height}}" />
|
<meta property="og:image:height" content="{{$img.Height}}" />
|
||||||
|
|
||||||
<!-- Twitter metadata (used by other websites as well) -->
|
|
||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<meta name="twitter:title" content="{{ .Title }}" />
|
<meta name="twitter:title" content="{{ .Title }}" />
|
||||||
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/>
|
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/>
|
||||||
<meta name="twitter:image" content="{{$img.Permalink}}" />
|
<meta name="twitter:image" content="{{$img.Permalink}}" />
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
|
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
|
||||||
{{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }}
|
|
||||||
{{- with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }}
|
{{- with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }}
|
||||||
{{- with .Params.videos }}{{- range . }}
|
{{- with .Params.videos }}{{- range . }}
|
||||||
<meta property="og:video" content="{{ . | absURL }}" />
|
<meta property="og:video" content="{{ . | absURL }}" />
|
||||||
|
|
Loading…
Reference in a new issue