Skip to content

Commit

Permalink
Pin guidelines/* content when publishing 2.2 docs to w3.org
Browse files Browse the repository at this point in the history
  • Loading branch information
kfranqueiro committed Dec 2, 2024
1 parent 7aad7a7 commit b7f246b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion 11ty/guidelines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,15 @@ const loadRemoteGuidelines = async (version: WcagVersion) => {
$("[role='note'] .marker").remove();
$("[role='note']").find("> div, > p").addClass("note").unwrap();

// Convert data-plurals (present in publications) to data-lt
$("dfn[data-plurals]").each((_, el) => {
el.attribs["data-lt"] = (el.attribs["data-lt"] || "")
.split("|")
.concat(el.attribs["data-plurals"].split("|"))
.join("|");
delete el.attribs["data-plurals"];
});

// Un-process bibliography references, to be processed by CustomLiquid
$("cite:has(a.bibref:only-child)").each((_, el) => {
const $el = $(el);
Expand All @@ -255,7 +264,7 @@ const loadRemoteGuidelines = async (version: WcagVersion) => {

// Remove generated IDs and markers from examples
$(".example[id]").removeAttr("id");
$(".example .marker:has(.self-link)").remove();
$(".example > .marker").remove();

// Remove extra markup from headings so they can be parsed for names
$("bdi").remove();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "tsx node_modules/@11ty/eleventy/cmd.cjs --config=eleventy.config.ts",
"check": "tsc",
"fmt": "prettier . -w",
"publish-w3c": "WCAG_MODE=publication npm run build && tsx 11ty/cp-cvs.ts",
"publish-w3c": "WCAG_VERSION=22 WCAG_MODE=publication npm run build && tsx 11ty/cp-cvs.ts",
"publish-w3c:21": "WCAG_VERSION=21 WCAG_MODE=publication npm run build && WCAG_VERSION=21 tsx 11ty/cp-cvs.ts",
"start": "npm run build -- --serve --incremental"
},
Expand Down

0 comments on commit b7f246b

Please sign in to comment.