From ce09debc7cd266a0b781830c24b7d89b7d650d47 Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Wed, 29 Jan 2025 06:29:55 -0500 Subject: [PATCH] Fail build upon encountering p w/ class="instructions" (#4199) --- 11ty/CustomLiquid.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/11ty/CustomLiquid.ts b/11ty/CustomLiquid.ts index 4c8a652d02..dd41c21a1f 100644 --- a/11ty/CustomLiquid.ts +++ b/11ty/CustomLiquid.ts @@ -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

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"];