Bump hugo version

Had to bring the opengraph template into the repo, as I use the `audio` param differently to what has become the default.

Removed some unused shortcodes.
This commit is contained in:
JP Hastings-Spital 2024-04-29 09:13:59 +01:00
parent 86f30abfc9
commit 9b53f01466
6 changed files with 74 additions and 11 deletions

View file

@ -26,7 +26,7 @@ jobs:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.124.1
HUGO_VERSION: 0.125.4
PAGEFIND_VERSION: 1.1.0
TASK_VERSION: 3.36.0
steps:

View file

@ -50,7 +50,7 @@
{{ template "_internal/schema.html" . }}
{{ if isset .Site.Taxonomies "series" }}
{{ template "_internal/opengraph.html" . }}
{{ template "partials/opengraph.html" . }}
{{ end }}
{{ range .Params.categories }}

View file

@ -0,0 +1,72 @@
<meta property="og:url" content="{{ .Permalink }}">
{{- with or site.Title site.Params.title | plainify }}
<meta property="og:site_name" content="{{ . }}">
{{- end }}
{{- with or .Title site.Title site.Params.title | plainify }}
<meta property="og:title" content="{{ . }}">
{{- end }}
{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape | chomp }}
<meta property="og:description" content="{{ . }}">
{{- end }}
{{- with or .Params.locale site.Language.LanguageCode site.Language.Lang }}
<meta property="og:locale" content="{{ . }}">
{{- end }}
{{- if .IsPage }}
<meta property="og:type" content="article">
{{- with .Section }}
<meta property="article:section" content="{{ . }}">
{{- end }}
{{- $ISO8601 := "2006-01-02T15:04:05-07:00" }}
{{- with .PublishDate }}
<meta property="article:published_time" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}>
{{- end }}
{{- with .Lastmod }}
<meta property="article:modified_time" {{ .Format $ISO8601 | printf "content=%q" | safeHTMLAttr }}>
{{- end }}
{{- range .GetTerms "tags" | first 6 }}
<meta property="article:tag" content="{{ .Page.Title | plainify }}">
{{- end }}
{{- else }}
<meta property="og:type" content="website">
{{- end }}
{{- with partial "_funcs/get-page-images" . }}
{{- range . | first 6 }}
<meta property="og:image" content="{{ .Permalink }}">
{{- end }}
{{- end }}
{{- with .Params.audio }}
<meta property="og:audio" content="{{ . | absURL }}">
{{- end }}
{{- with .Params.videos }}
{{- range . | first 6 }}
<meta property="og:video" content="{{ . | absURL }}">
{{- end }}
{{- end }}
{{- range .GetTerms "series" }}
{{- range .Pages | first 7 }}
{{- if ne $ . }}
<meta property="og:see_also" content="{{ .Permalink }}">
{{- end }}
{{- end }}
{{- end }}
{{- with site.Params.social }}
{{- if reflect.IsMap . }}
{{- with .facebook_app_id }}
<meta property="fb:app_id" content="{{ . }}">
{{- else }}
{{- with .facebook_admin }}
<meta property="fb:admins" content="{{ . }}">
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -1,5 +0,0 @@
<svg class="theme-toggler" width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M22 41C32.4934 41 41 32.4934 41 22C41 11.5066 32.4934 3 22
3C11.5066 3 3 11.5066 3 22C3 32.4934 11.5066 41 22 41ZM7 22C7
13.7157 13.7157 7 22 7V37C13.7157 37 7 30.2843 7 22Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 320 B

View file

@ -1,3 +0,0 @@
{{ if .Get "src" }}
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}" {{ end }} class="{{ with .Get "position"}}{{ . }}{{ else -}} left {{- end }}" {{ with .Get "style" }} style="{{ . | safeCSS }}" {{ end }} />
{{ end }}

View file

@ -1 +0,0 @@
<em>Last updated {{ partial "year-relative-date.html" .Page.Lastmod }}</em>