Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/scripts/build/strip_unknown_frontmatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- tool-managed: version (set by ai/update_versions_and_changelogs.py),
keywords (set by ai/tasks/generate_intros.py), original-filename (set by
the technical-library scripts)
- licence override: license + license-url (defaults in _meta/includes)

Anything else (toc/toc-depth/toc-title, deprecated fields, typos, external-
project metadata) gets dropped silently.
Expand Down Expand Up @@ -40,6 +41,11 @@
# Kept (not stripped) so fill_version / inject_changelog / strip_llms can
# read it downstream.
"type",
# Per-document licence override. Both are needed: `license` drives Quarto's
# HTML appendix, `license-url` the json-ld block. Defaults live in
# _meta/includes/default*.yml; the PR-time validator requires the pair.
"license",
"license-url",
}

EXCLUDED_DIRS = {"templates", "theme", "includes", "_meta", "_site", ".quarto"}
Expand Down
15 changes: 15 additions & 0 deletions .github/scripts/validate_qmd_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,21 @@ def validate_qmd(file_path: Path) -> List[str]:
if author is not None and not isinstance(author, (str, list)):
issues.append("author, if present, must be a string or list of strings")

# `license` feeds Quarto's HTML appendix; `license-url` feeds the json-ld
# block, which cannot read `license` back (Quarto consumes it). Setting one
# alone silently publishes two different licences, so require the pair.
license_v = metadata.get("license")
license_url = metadata.get("license-url")
if (license_v is None) != (license_url is None):
present, missing = (
("license", "license-url")
if license_v is not None
else ("license-url", "license")
)
issues.append(
f"{present} is set but {missing} is not; override both or neither"
)

return issues


Expand Down
3 changes: 2 additions & 1 deletion _meta/includes/default-no-headers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ toc-depth: 3 # Include headings up to level 3 (###)
number-sections: true
sitemap: true # Enables sitemap generation for web crawlers
tbl-colwidths: auto
license: "EUPL (>= 1.2)"
license: "https://creativecommons.org/licenses/by/4.0/"
license-url: "https://creativecommons.org/licenses/by/4.0/"
format:
html:
include-in-header:
Expand Down
3 changes: 2 additions & 1 deletion _meta/includes/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ toc-depth: 3 # Include headings up to level 3 (###)
number-sections: true
sitemap: true # Enables sitemap generation for web crawlers
tbl-colwidths: auto
license: "EUPL (>= 1.2)"
license: "https://creativecommons.org/licenses/by/4.0/"
Comment thread
mckeea marked this conversation as resolved.
license-url: "https://creativecommons.org/licenses/by/4.0/"
format:
html:
include-in-header:
Expand Down
2 changes: 1 addition & 1 deletion _meta/includes/json-ld.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"articleSection": "General",
"isAccessibleForFree": "true",
"license": "{{< meta license | default: '' >}}",
"license": "{{< meta license-url >}}",
"speakable": {
"@type": "SpeakableSpecification",
"cssSelector": "article p"
Expand Down