artist-gallery-theme

Hugo theme made for websites with loads of images
Log | Files | Refs | README | LICENSE

opengraph.html (2403B)


      1 <meta property="og:title" content="{{ .Title }}" />
      2 <meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
      3 <meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
      4 <meta property="og:url" content="{{ .Permalink }}" />
      5 
      6 {{- with .Params.image }}
      7 {{ $image := $.Resources.GetMatch . }}
      8 {{ with $image }}
      9   {{ $thumb := .Resize "400x" }}
     10 <meta property="og:image" content="{{ $thumb.Permalink }}">
     11 {{ end }}
     12 {{ end }}
     13 
     14 {{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
     15 {{- if .IsPage }}
     16 {{- if not .PublishDate.IsZero }}<meta property="article:published_time" {{ .PublishDate.Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />
     17 {{ else if not .Date.IsZero }}<meta property="article:published_time" {{ .Date.Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />
     18 {{ end }}
     19 {{- end }}{{/* .IsPage */}}
     20 
     21 {{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
     22 {{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }}
     23 {{- with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }}
     24 {{- with .Params.videos }}
     25 {{- range . }}
     26 <meta property="og:video" content="{{ . | absURL }}" />
     27 {{ end }}{{ end }}
     28 
     29 {{- /* If it is part of a series, link to related articles */}}
     30 {{- $permalink := .Permalink }}
     31 {{- $siteSeries := .Site.Taxonomies.series }}{{ with .Params.series }}
     32 {{- range $name := . }}
     33   {{- $series := index $siteSeries $name }}
     34   {{- range $page := first 6 $series.Pages }}
     35     {{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }}
     36   {{- end }}
     37 {{ end }}{{ end }}
     38 
     39 {{- if .IsPage }}
     40 {{- range .Site.Params.Authors }}{{ with .Social.facebook }}
     41 <meta property="article:author" content="https://www.facebook.com/{{ . }}" />{{ end }}{{ with .Site.Params.Social.facebook }}
     42 <meta property="article:publisher" content="https://www.facebook.com/{{ . }}" />{{ end }}
     43 <meta property="article:section" content="{{ .Section }}" />
     44 {{- with .Params.tags }}{{ range first 6 . }}
     45 <meta property="article:tag" content="{{ . }}" />{{ end }}{{ end }}
     46 {{- end }}{{ end }}
     47 
     48 {{- /* Facebook Page Admin ID for Domain Insights */}}
     49 {{- with .Site.Params.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}