Schema-Markup-Mechanismus für templated Sites (custom Sites bleiben unberührt).
- templates/base.html: {{schema_jsonld}} Slot im <head>.
- site.yaml: optionaler `schema:` Block. `type:` -> `@type`, `@context`
wird automatisch ergänzt. Fehlt der Block, bleibt der Slot leer.
- render.sh: liest schema via `yq -o=json`, transformiert mit jq, fügt
Template-Default für `type` ein (person-* -> Person, product-* -> Product,
editorial -> Article).
- render.sh: literal-string replace (lreplace) statt awk gsub für multiline-
Substitution. Behebt nebenbei einen latenten Bug, bei dem `©` im
template_body als `{{body}}copy;` corrupted wurde (gsub interpretierte
`&` als matched text).
- tests/schema-test.sh + 4 Fixtures: validiert explicit type, Template-
Defaults für 3 Templates, leerer Slot ohne schema-Block.
- README.md: Schema.org-Konvention dokumentiert (Block-Format, Defaults,
Custom-Sites-Hinweis, Schema.org-Validator-Link).
QA: ./build.sh -> 59 sites OK, custom Sites byte-identical zur Source,
3 templated Fixtures rendern valides JSON-LD (Person/Product/Article),
no-schema-Fixture produziert keinen <script>-Tag.
Closes #9 nicht - head reviewed + merged.
18 lines
364 B
YAML
18 lines
364 B
YAML
domain: example-noschema.de
|
|
template: minimal
|
|
title: "No Schema Test"
|
|
description: "A minimal site without a schema block."
|
|
lang: de
|
|
|
|
vars:
|
|
name: "Test"
|
|
tagline: "Empty schema slot expected."
|
|
accent: "#c9a84c"
|
|
accent_light: "rgba(201, 168, 76, 0.1)"
|
|
font_primary: "Inter"
|
|
font_secondary: "Inter"
|
|
sections: []
|
|
cta:
|
|
text: "Kontakt"
|
|
href: "#"
|