github.com/square/finch@v0.0.0-20240412205204-6530c03e2b96/docs/themes/hugo-geekdoc/layouts/partials/microformats/opengraph.html (about)

     1  {{ $isPage := or (and (ne .Type "posts") (in "section page" .Kind )) (and (eq .Type "posts") (eq .Kind "page")) }}
     2  
     3  {{- if ne .Kind "home" }}
     4    <meta
     5      property="og:title"
     6      {{ partial "utils/title" . | printf "content=%q" | safeHTMLAttr }}
     7    />
     8  {{- end }}
     9  {{- with .Site.Title }}
    10    <meta property="og:site_name" {{ . | printf "content=%q" | safeHTMLAttr }} />
    11  {{- end }}
    12  {{- with partial "utils/featured" . }}
    13    <meta property="og:image" content="{{ . }}" />
    14  {{- end }}
    15  {{- with partial "utils/description" . }}
    16    <meta property="og:description" content="{{ . | plainify | htmlUnescape | chomp }}" />
    17  {{- end }}
    18  <meta property="og:type" content="{{ if $isPage }}article{{ else }}website{{ end }}" />
    19  <meta property="og:url" content="{{ .Permalink }}" />
    20  {{- with .Params.audio }}
    21    <meta property="og:audio" content="{{ . }}" />
    22  {{- end }}
    23  {{- with .Params.locale }}
    24    <meta property="og:locale" content="{{ . }}" />
    25  {{- end }}
    26  {{- with .Params.videos }}
    27    {{- range . }}
    28      <meta property="og:video" content="{{ . | absURL }}" />
    29    {{- end }}
    30  {{- end }}
    31  
    32  {{- /* If it is part of a series, link to related articles */}}
    33  {{- if .Site.Taxonomies.series }}
    34    {{- $permalink := .Permalink -}}
    35    {{- $siteSeries := .Site.Taxonomies.series -}}
    36    {{- with .Params.series }}
    37      {{- range $name := . }}
    38        {{- $series := index $siteSeries ($name | urlize) }}
    39        {{- range $page := first 6 $series.Pages }}
    40          {{- if ne $page.Permalink $permalink }}
    41            <meta property="og:see_also" content="{{ $page.Permalink }}" />
    42          {{- end }}
    43        {{- end }}
    44      {{- end }}
    45    {{- end }}
    46  {{- end }}
    47  
    48  {{ if $isPage -}}
    49    {{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
    50    <meta property="article:section" content="{{ .Section | humanize | title }}" />
    51    {{- with .PublishDate }}
    52      <meta
    53        property="article:published_time"
    54        {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }}
    55      />
    56    {{- end }}
    57    {{- with .Lastmod }}
    58      <meta
    59        property="article:modified_time"
    60        {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }}
    61      />
    62    {{- end }}
    63  {{- end }}
    64  
    65  {{- /* Facebook Page Admin ID for Domain Insights */}}
    66  {{- with .Site.Social.facebook_admin }}
    67    <meta property="fb:admins" content="{{ . }}" />
    68  {{- end }}