Skip to content

Commit

Permalink
Fail build upon encountering p w/ class="instructions" (#4199)
Browse files Browse the repository at this point in the history
  • Loading branch information
kfranqueiro authored Jan 29, 2025
1 parent 06dcf88 commit ce09deb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion 11ty/CustomLiquid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,16 @@ export class CustomLiquid extends Liquid {
// (e.g. editors.css & sources.css, and leftover template paragraphs)
// NOTE: some paragraphs with the "instructions" class actually have custom content,
// but for now this remains consistent with the XSLT process by stripping all of them.
$(".remove, p.instructions, section#meta, section.meta").remove();
$(".remove, section#meta, section.meta").remove();

if ($("p.instructions").length > 0) {
console.error(`${filepath} contains a <p class="instructions"> element.\n` +
" This suggests that a template was copied and not fully filled out.\n" +
" If the paragraph has been modified and should be retained, remove the class.\n" +
" Otherwise, if the corresponding section has been updated, remove the paragraph."
);
throw new Error("Instructions paragraph found; please resolve.")
}

const prependedIncludes = ["header"];
const appendedIncludes = ["wai-site-footer", "site-footer"];
Expand Down

0 comments on commit ce09deb

Please sign in to comment.