From e20756988035c75b8bff71674bb58e47e2ed899c Mon Sep 17 00:00:00 2001 From: Matteo Mattiuzzi Date: Thu, 30 Jul 2026 17:25:47 +0000 Subject: [PATCH 1/2] feat: set default document licence to CC BY 4.0 --- _meta/includes/default.yml | 2 +- _meta/includes/json-ld.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_meta/includes/default.yml b/_meta/includes/default.yml index 4792373c..25d769b9 100644 --- a/_meta/includes/default.yml +++ b/_meta/includes/default.yml @@ -5,7 +5,7 @@ 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/" format: html: include-in-header: diff --git a/_meta/includes/json-ld.html b/_meta/includes/json-ld.html index e9c08c93..ac7eec47 100644 --- a/_meta/includes/json-ld.html +++ b/_meta/includes/json-ld.html @@ -19,7 +19,7 @@ }, "articleSection": "General", "isAccessibleForFree": "true", - "license": "{{< meta license | default: '' >}}", + "license": "{{< meta license | default: 'https://creativecommons.org/licenses/by/4.0/' >}}", "speakable": { "@type": "SpeakableSpecification", "cssSelector": "article p" From c14f6936695999ff1bb69f38b138a28098e52c66 Mon Sep 17 00:00:00 2001 From: mckeea Date: Thu, 6 Aug 2026 13:26:03 +0000 Subject: [PATCH 2/2] feat: default documents to CC BY 4.0 and allow per-document override --- .../scripts/build/strip_unknown_frontmatter.py | 6 ++++++ .github/scripts/validate_qmd_files.py | 15 +++++++++++++++ _meta/includes/default-no-headers.yml | 3 ++- _meta/includes/default.yml | 1 + _meta/includes/json-ld.html | 2 +- 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/scripts/build/strip_unknown_frontmatter.py b/.github/scripts/build/strip_unknown_frontmatter.py index 1de846f6..c21af5de 100644 --- a/.github/scripts/build/strip_unknown_frontmatter.py +++ b/.github/scripts/build/strip_unknown_frontmatter.py @@ -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. @@ -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"} diff --git a/.github/scripts/validate_qmd_files.py b/.github/scripts/validate_qmd_files.py index 219cc201..529cd5c7 100644 --- a/.github/scripts/validate_qmd_files.py +++ b/.github/scripts/validate_qmd_files.py @@ -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 diff --git a/_meta/includes/default-no-headers.yml b/_meta/includes/default-no-headers.yml index 8882fae7..aef73228 100644 --- a/_meta/includes/default-no-headers.yml +++ b/_meta/includes/default-no-headers.yml @@ -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: diff --git a/_meta/includes/default.yml b/_meta/includes/default.yml index 25d769b9..a3baf95b 100644 --- a/_meta/includes/default.yml +++ b/_meta/includes/default.yml @@ -6,6 +6,7 @@ number-sections: true sitemap: true # Enables sitemap generation for web crawlers tbl-colwidths: auto license: "https://creativecommons.org/licenses/by/4.0/" +license-url: "https://creativecommons.org/licenses/by/4.0/" format: html: include-in-header: diff --git a/_meta/includes/json-ld.html b/_meta/includes/json-ld.html index ac7eec47..e6e02e46 100644 --- a/_meta/includes/json-ld.html +++ b/_meta/includes/json-ld.html @@ -19,7 +19,7 @@ }, "articleSection": "General", "isAccessibleForFree": "true", - "license": "{{< meta license | default: 'https://creativecommons.org/licenses/by/4.0/' >}}", + "license": "{{< meta license-url >}}", "speakable": { "@type": "SpeakableSpecification", "cssSelector": "article p"