Port head partials: SEO, OG, JSON-LD, AI disclosure, tag-nav
- 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
This commit is contained in:
parent
da1d02ccd1
commit
5deaa22e38
8 changed files with 231 additions and 39 deletions
41
layouts/partials/meta/og.html
Normal file
41
layouts/partials/meta/og.html
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{{- /*
|
||||
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 }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue