asw-v01: archive deferred content (packs, site, lab, legacy examples)

- 2.1: packs/ -> archive/packs/
- 2.2: site/ -> archive/site/
- 2.3: src/lab/ -> archive/lab/
- 2.4: examples/ -> archive/examples-legacy/ (SSI-based)
This commit is contained in:
exe.dev user 2026-06-07 10:39:21 +02:00
parent 416fe2f180
commit e47a9f4401
173 changed files with 11 additions and 5 deletions

View file

@ -0,0 +1,62 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="dark">
<title>
{{- if .IsHome -}}
{{ .Site.Title }}
{{- else -}}
{{ .Title }} · {{ .Site.Title }}
{{- end -}}
</title>
{{- with .Description }}<meta name="description" content="{{ . }}">{{- end }}
{{- if not .Description }}{{- with .Site.Params.description }}<meta name="description" content="{{ . }}">{{- end }}{{- end }}
{{- /* ── Meta partials ─────────────────────────────────────────── */}}
{{- partial "meta/seo.html" . -}}
{{- partial "meta/og.html" . -}}
{{- partial "meta/ai-disclosure.html" . -}}
{{- partial "meta/json-ld.html" . -}}
{{- /* ── CSS ────────────────────────────────────────────────────── */}}
{{- if hugo.IsDevelopment }}
<link rel="stylesheet" href="/vendor/open-props.min.css">
<link rel="stylesheet" href="/vendor/media.min.css">
<link rel="stylesheet" href="/css/layers/00-reset.css">
<link rel="stylesheet" href="/css/layers/01-tokens.css">
<link rel="stylesheet" href="/css/layers/02-typography.css">
<link rel="stylesheet" href="/css/layers/03-landmarks.css">
<link rel="stylesheet" href="/css/layers/04-forms.css">
<link rel="stylesheet" href="/css/layers/05-components.css">
<link rel="stylesheet" href="/css/layers/06-navigation.css">
<link rel="stylesheet" href="/css/layers/07-data-attrs.css">
<link rel="stylesheet" href="/css/layers/08-utilities.css">
<link rel="stylesheet" href="/css/layers/09-charts.css">
<link rel="stylesheet" href="/css/layers/10-chroma.css">
<link rel="stylesheet" href="/css/layers/11-layout.css">
<link rel="stylesheet" href="/css/layers/12-landing.css">
{{- else }}
<link rel="stylesheet" href="/asw.css">
{{- end }}
{{- range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
{{- end }}
<script>
// Theme toggle — respects OS preference, persists choice
(function(){
var s = localStorage.getItem('theme');
if (s) document.documentElement.setAttribute('data-theme', s);
document.addEventListener('click', function(e) {
var b = e.target.closest('[data-theme-toggle]');
if (!b) return;
var current = document.documentElement.getAttribute('data-theme')
|| (matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark');
var next = current === 'light' ? 'dark' : 'light';
document.documentElement.setAttribute('data-theme', next);
localStorage.setItem('theme', next);
});
})();
</script>
<!-- Umami analytics — estate dashboard -->
<script defer src="https://analytics.trentuna.com/script.js" data-website-id="9546a046-b901-471f-bfed-88c874786435"></script>

View file

@ -0,0 +1,25 @@
{{- /*
partials/meta/ai-disclosure.html — AI-generated content disclosure
Emits the proposed W3C/WHATWG AI content disclosure meta tag and the
corresponding HTTP-equiv header that satisfies EU AI Act Article 50
obligations for AI-generated/AI-assisted web content.
The disclosure level is controlled per-page via front matter:
ai_content: "generated" — fully AI-generated content
ai_content: "assisted" — human-written with AI assistance (default)
ai_content: "reviewed" — AI-generated, human-reviewed and edited
ai_content: "none" — no AI involvement (suppresses the tag)
Site-wide default in hugo.toml:
[params]
ai_content = "assisted" # default for all pages
Reference:
https://github.com/nickvdyck/ai-content-disclosure
EU AI Act Article 50 (transparency obligations, Chapter IV)
*/ -}}
{{- $level := or .Params.ai_content .Site.Params.ai_content "assisted" -}}
{{- if ne $level "none" -}}
<meta name="ai-content-disclosure" content="{{ $level }}">
{{- end }}

View file

@ -0,0 +1,101 @@
{{- /*
partials/meta/json-ld.html — JSON-LD structured data (Schema.org)
Emits one <script type="application/ld+json"> block per page.
Uses dict → jsonify → safeHTML to avoid Hugo's JS-context escaping.
Schema selection:
Home page → WebSite (with SearchAction if params.search_url set)
Docs pages → TechArticle (front matter: type = "docs")
Dated pages → Article
Everything else → WebPage
BreadcrumbList appended when .Ancestors is non-empty.
Configure in hugo.toml:
[params]
author = "Trentuna" # publisher/author name
logo = "/images/logo.png" # site logo for publisher
search_url = "/search/?q={q}" # enables SearchAction on WebSite
*/ -}}
{{- $author := or .Site.Params.author .Site.Title -}}
{{- $logo := .Site.Params.logo | default "" -}}
{{- $desc := or .Description .Site.Params.description "" -}}
{{- $image := or .Params.image .Site.Params.og_image "" -}}
{{- if .IsHome -}}
{{- /* ── WebSite ──────────────────────────────────────────────────── */}}
{{- $data := dict
"@context" "https://schema.org"
"@type" "WebSite"
"name" .Site.Title
"url" .Site.BaseURL
"description" $desc
-}}
{{- with .Site.Params.search_url -}}
{{- $action := dict
"@type" "SearchAction"
"target" (dict "@type" "EntryPoint" "urlTemplate" (printf "%s%s" $.Site.BaseURL .))
"query-input" "required name=q"
-}}
{{- $data = merge $data (dict "potentialAction" $action) -}}
{{- end -}}
{{- printf "<script type=\"application/ld+json\">%s</script>" ($data | jsonify) | safeHTML -}}
{{- else -}}
{{- /* ── Article / TechArticle / WebPage ─────────────────────────── */}}
{{- $schemaType := "WebPage" -}}
{{- if and .IsPage (not .IsSection) -}}
{{- if eq .Params.type "docs" -}}
{{- $schemaType = "TechArticle" -}}
{{- else if .Date -}}
{{- $schemaType = "Article" -}}
{{- end -}}
{{- end -}}
{{- $publisher := dict "@type" "Organization" "name" $author -}}
{{- with $logo -}}
{{- $publisher = merge $publisher (dict "logo" (dict "@type" "ImageObject" "url" (. | absURL))) -}}
{{- end -}}
{{- $data := dict
"@context" "https://schema.org"
"@type" $schemaType
"headline" .Title
"description" $desc
"url" .Permalink
"author" $publisher
"publisher" $publisher
-}}
{{- with $image -}}
{{- $data = merge $data (dict "image" (. | absURL)) -}}
{{- end -}}
{{- if and .Date (not .IsSection) -}}
{{- $data = merge $data (dict
"datePublished" (.Date.Format "2006-01-02T15:04:05Z07:00")
"dateModified" (.Lastmod.Format "2006-01-02T15:04:05Z07:00")
) -}}
{{- end -}}
{{- /* BreadcrumbList: .Ancestors is nearest→root; iterate by index to reverse */}}
{{- with .Ancestors -}}
{{- $ancs := . -}}
{{- $len := len $ancs -}}
{{- $items := slice -}}
{{- range $i := seq $len -}}
{{- $a := index $ancs (sub $len $i) -}}
{{- $item := dict "@type" "ListItem" "position" $i "name" $a.Title "item" $a.Permalink -}}
{{- $items = $items | append $item -}}
{{- end -}}
{{- $last := dict "@type" "ListItem" "position" (add $len 1) "name" $.Title "item" $.Permalink -}}
{{- $items = $items | append $last -}}
{{- $crumb := dict "@type" "BreadcrumbList" "itemListElement" $items -}}
{{- $data = merge $data (dict "breadcrumb" $crumb) -}}
{{- end -}}
{{- printf "<script type=\"application/ld+json\">%s</script>" ($data | jsonify) | safeHTML -}}
{{- end }}

View 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 }}

View file

@ -0,0 +1,16 @@
{{- /*
partials/meta/seo.html — canonical URL + robots directives
Outputs:
<link rel="canonical"> Always emitted; uses .Permalink (absolute).
<meta name="robots"> "noindex, nofollow" on draft/future pages,
"index, follow" otherwise.
No params required. Works from any page context.
*/ -}}
<link rel="canonical" href="{{ .Permalink }}">
{{- if or .Draft (gt .Date now) }}
<meta name="robots" content="noindex, nofollow">
{{- else }}
<meta name="robots" content="index, follow">
{{- end }}

View file

@ -0,0 +1,29 @@
<nav>
<ul><li><a href="/"><strong>{{ .Site.Title }}</strong></a></li></ul>
<ul data-nav-links>
{{- range sort .Site.Data.nav.items "weight" }}
<li><a href="{{ .url }}"{{ if eq (relURL .url) $.RelPermalink }} aria-current="page"{{ end }}>{{ .name }}</a></li>
{{- end }}
</ul>
<button data-nav-toggle aria-label="Menu" hidden></button>
<button data-theme-toggle aria-label="Toggle theme"></button>
</nav>
<script>
// Hamburger — toggle nav links on mobile
(function(){
var btn = document.querySelector('[data-nav-toggle]');
var links = document.querySelector('[data-nav-links]');
if (!btn || !links) return;
// Show button only when JS is available
if (matchMedia('(max-width:767.98px)').matches) btn.hidden = false;
matchMedia('(max-width:767.98px)').addEventListener('change', function(e) {
btn.hidden = !e.matches;
if (!e.matches) links.removeAttribute('data-collapsed');
});
btn.addEventListener('click', function() {
var open = links.hasAttribute('data-collapsed');
if (open) links.removeAttribute('data-collapsed');
else links.setAttribute('data-collapsed', '');
});
})();
</script>

View file

@ -0,0 +1,21 @@
{{- /*
tag-nav.html — renders all site tags as a navigable tag cloud.
Usage in a layout:
{{ partial "tag-nav.html" . }}
Outputs: <nav data-role="tag-cloud"> with links to each tag page.
The (N) count shows how many pages have each tag.
*/ -}}
{{- $tags := .Site.Taxonomies.tags -}}
{{- if $tags }}
<nav data-role="tag-cloud" aria-label="Browse by tag">
{{- range $name, $pages := $tags }}
{{- $tagPage := site.GetPage (printf "/tags/%s" ($name | urlize)) }}
<a href="{{ if $tagPage }}{{ $tagPage.Permalink }}{{ else }}{{ print site.BaseURL "tags/" ($name | urlize) "/" }}{{ end }}" data-tag="{{ $name }}">
{{ $name -}}
<small>({{ len $pages }})</small>
</a>
{{- end }}
</nav>
{{- end }}