www.byjp.me/layouts/partials/head.html
JP Hastings-Spital 9bf8444c49 Bump Hugo version
2025-01-14 13:35:14 +00:00

70 lines
3.4 KiB
HTML

{{- $title := $.Site.Title -}}
{{- if not .IsHome -}}{{ $title = printf "%s, %s" (partial "page-title.txt" .) $.Site.Title }}{{ end -}}
{{- $modified := .Lastmod -}}
{{- if .IsHome }}{{ with getenv "HUGO_LAST_UPDATE_TIME" }}{{ $modified = time . }}{{ end }}{{ end -}}
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<meta name="author" content="{{ if .Params.author }}{{ .Params.author }}{{ else }}{{ range .Site.Params.Author }}{{ . }} {{ end }}{{ end }}"/>
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.homeSubtitle }}{{ else }}{{ if .Params.Description }}{{ .Params.Description }}{{ else }}{{ .Summary | plainify }}{{ end }}{{ end }}" class="p-summary"/>
<meta name="keywords" content="{{ .Site.Params.keywords }}{{ if .Params.tags }}{{ range .Params.tags }}, {{ . }}{{ end }}{{ end }}"/>
<meta name="theme-color" content="{{ .Site.Params.themeColor }}"/>
<meta property="dcterms.modified" content="{{ $modified.Format "2006-01-02T15:04:05Z07:00"}}"/>
<link rel="canonical" href="{{ .Permalink }}" class="u-url"/>
{{ with partial "shortlink.txt" . -}}
<link rel="shortlink" href="https://{{ site.Params.shortlinkhost }}/{{ . }}" class="u-url" />
{{- end }}
<link rel="schema.dcterms" href="http://purl.org/dc/terms/"/>
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="{{ .Site.Title }}"/>
<link rel="search" type="application/pagefind" href="/search" title="{{ .Site.Title }}"/>
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type (partial "noindex.gmi" .Permalink) (printf "%s (%s)" $title (partial "alternatename.txt" .Name)) | safeHTML }}
{{ end }}
{{/* IndieWeb */}}
<link rel="webmention" href="https://webmention.io/www.byjp.me/webmention">
{{ with getenv "HUGO_INDIEKIT_URL" }}
<link rel="authorization_endpoint" href="{{ . }}/auth">
<link rel="token_endpoint" href="{{ . }}/auth/token">
<link rel="indieauth-metadata" href="{{ . }}/.well-known/oauth-authorization-server">
<link rel="micropub" href="{{ . }}/micropub">
{{ end }}
{{ block "title" . -}}
<title>
{{- if .IsHome -}}
{{- $.Site.Title -}}
{{- else -}}
{{ partial "page-title.txt" . }}, {{ $.Site.Title -}}
{{- end -}}
</title>
{{- end }}
<link href="/css/postcards.css" rel="stylesheet" type="text/css">
{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true) -}}
{{ $style := resources.Get "scss/main.scss" | css.Sass $options | resources.Fingerprint -}}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
{{ range $val := $.Site.Params.customCSS -}}
{{ if le (len $val) 0 }}{{ continue }}{{ end -}}
<link rel="stylesheet" type="text/css" href="{{ $val }}">
{{ end }}
<!-- Icons -->
{{- partial "favicons.html" . }}
{{ template "_internal/schema.html" . }}
{{ if isset .Site.Taxonomies "series" }}
{{ template "partials/opengraph.html" . }}
{{ end }}
{{ range .Params.categories }}
<meta property="article:section" content="{{ . }}" />
{{ end }}
{{ if isset .Params "date" }}
<meta property="article:published_time" content="{{ time .Date }}" />
{{ end }}
<!-- Custom head tags -->
{{- if templates.Exists "partials/extra-head.html" -}}
{{ partial "extra-head.html" . }}
{{- end }}