- layouts/partials/head.html: full <head> partial with meta partials + CSS pipeline - layouts/partials/meta/seo.html: canonical URL + robots directives - layouts/partials/meta/og.html: Open Graph + Twitter Card meta tags - layouts/partials/meta/ai-disclosure.html: AI content disclosure (EU AI Act) - layouts/partials/meta/json-ld.html: Schema.org JSON-LD structured data - layouts/partials/tag-nav.html: site-wide tag cloud partial - layouts/_default/baseof.html: simplified to use partial head.html - layouts/_default/single.html: removed inline head block (now in head.html) Verified: canonical, robots, OG tags, ai-content-disclosure on live pages. 96 pages build clean. Closes: asw#15
41 lines
1.7 KiB
HTML
41 lines
1.7 KiB
HTML
{{- /*
|
|
partials/meta/og.html — Open Graph + Twitter Card meta tags
|
|
|
|
og:title Page title (site title for home page)
|
|
og:description .Description → .Site.Params.description → ""
|
|
og:url .Permalink
|
|
og:type "website" (home) | "article" (everything else)
|
|
og:site_name .Site.Title
|
|
og:image .Params.image → .Site.Params.og_image → absent
|
|
twitter:card "summary_large_image" when image present, else "summary"
|
|
twitter:site .Site.Params.twitter (optional @handle)
|
|
|
|
Configure in hugo.toml:
|
|
[params]
|
|
og_image = "/images/og-default.png" # fallback OG image
|
|
twitter = "@yourhandle" # omit if not on Twitter/X
|
|
*/ -}}
|
|
{{- $title := cond .IsHome .Site.Title (printf "%s · %s" .Title .Site.Title) -}}
|
|
{{- $desc := or .Description .Site.Params.description "" -}}
|
|
{{- $image := or .Params.image .Site.Params.og_image "" -}}
|
|
{{- $type := cond .IsHome "website" "article" -}}
|
|
|
|
<meta property="og:title" content="{{ $title }}">
|
|
<meta property="og:description" content="{{ $desc }}">
|
|
<meta property="og:url" content="{{ .Permalink }}">
|
|
<meta property="og:type" content="{{ $type }}">
|
|
<meta property="og:site_name" content="{{ .Site.Title }}">
|
|
{{- with $image }}
|
|
<meta property="og:image" content="{{ . | absURL }}">
|
|
{{- end }}
|
|
|
|
{{- /* Twitter / X Card */}}
|
|
<meta name="twitter:card" content="{{ if $image }}summary_large_image{{ else }}summary{{ end }}">
|
|
<meta name="twitter:title" content="{{ $title }}">
|
|
<meta name="twitter:description" content="{{ $desc }}">
|
|
{{- with $image }}
|
|
<meta name="twitter:image" content="{{ . | absURL }}">
|
|
{{- end }}
|
|
{{- with .Site.Params.twitter }}
|
|
<meta name="twitter:site" content="{{ . }}">
|
|
{{- end }}
|