|
| 1 | +{{/* These meta tags are rendered only in the posts section (i.e. in single/list page) */}} |
| 2 | +{{ if eq .Section "posts" }} |
| 3 | + {{ $ISO_date := dateFormat "2006-01-02T15:04:05Z0700" .Date | safeHTML }} |
| 4 | + <!-- Pagination meta tags for list pages only --> |
| 5 | + {{ if ne .Page.Kind "page" }} |
| 6 | + {{ $paginator := .Paginate (where .Pages "Section" "blog") }} |
| 7 | + {{ if $paginator }} |
| 8 | + <link rel="first" href="{{ $paginator.First.URL }}" /> |
| 9 | + <link rel="last" href="{{ $paginator.Last.URL }}" /> |
| 10 | + {{ if $paginator.HasPrev }} |
| 11 | + <link rel="prev" href="{{ $paginator.Prev.URL }}" /> |
| 12 | + {{end }} |
| 13 | + {{ if $paginator.HasNext }} |
| 14 | + <link rel="next" href="{{ $paginator.Next.URL }}" /> |
| 15 | + {{end }} |
| 16 | + {{end }} |
| 17 | + {{end }} |
| 18 | + |
| 19 | + <meta property="og:type" content="article" /> |
| 20 | + <meta property="og:article:published_time" content={{ $ISO_date | safeHTML }} /> |
| 21 | + <meta property="article:published_time" content={{ $ISO_date | safeHTML }} /> |
| 22 | + <meta property="og:url" content="{{ .Permalink }}" /> |
| 23 | + |
| 24 | + {{ with.Site.Params.author }} |
| 25 | + <meta property="og:article:author" content="{{ .name }}" /> |
| 26 | + <meta property="article:author" content="{{ .name }}" /> |
| 27 | + <meta name="author" content="{{ .name }}" /> |
| 28 | + {{ with.fediverseAccount }} |
| 29 | + <meta name="fediverse:creator" content="{{ . }}" />{{/* ref https://blog.joinmastodon.org/2024/07/highlighting-journalism-on-mastodon/ */}} |
| 30 | + {{ end }} |
| 31 | + {{ end }} |
| 32 | + |
| 33 | + {{ with.Params.category }} |
| 34 | + <meta name="news_keywords" content="{{ index . 0 }}" /> |
| 35 | + <meta property="article:section" content="{{ index . 0 }}" /> |
| 36 | + {{ end }} |
| 37 | + |
| 38 | + <script defer type="application/ld+json"> |
| 39 | + { |
| 40 | + "@context": "https://schema.org", |
| 41 | + "@type": "Article", |
| 42 | + "headline": {{ .Title }}, |
| 43 | + "author": { |
| 44 | + "@type": "Person", |
| 45 | + "name": "{{ .Site.Params.github }}" |
| 46 | + }, |
| 47 | + "datePublished": "{{ dateFormat "2006-01-02" .Date }}", |
| 48 | + "description": {{ .Description }}, |
| 49 | + "wordCount": {{ .WordCount }}, |
| 50 | + "mainEntityOfPage": "True", |
| 51 | + "dateModified": "{{ dateFormat "2006-01-02" .Lastmod }}", |
| 52 | + "image": { |
| 53 | + "@type": "ImageObject", |
| 54 | + "url": "{{ with .Params.images }}{{ index . 0 | absURL }}{{ end }}", |
| 55 | + "width": 1200, |
| 56 | + "height": 630 |
| 57 | + }, |
| 58 | + "publisher": { |
| 59 | + "@type": "Organization", |
| 60 | + "name": "{{ .Site.Title }}" |
| 61 | + } |
| 62 | + } |
| 63 | + </script> |
| 64 | +{{ end }} |
0 commit comments