Skip to content
Merged
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
4 changes: 4 additions & 0 deletions 11ty/CustomLiquid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ export class CustomLiquid extends Liquid {
const prependedIncludes = ["header"];
const appendedIncludes = ["wai-site-footer", "site-footer"];

// Include draft banner at top of informative pages for GH Pages builds and PR previews
if (process.env.WCAG_MODE === "editors" || (process.env.COMMIT_REF && !process.env.WCAG_MODE))
prependedIncludes.unshift("draft-banner");

if (isUnderstanding)
prependedIncludes.push(
isIndex ? "understanding/navigation-index" : "understanding/navigation"
Expand Down
10 changes: 10 additions & 0 deletions _includes/draft-banner.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{%- comment -%}
Banner shown only on builds of informative docs for GitHub Pages.
{%- endcomment -%}
{%- assign pubSlug = page.url | replace: "techniques", "Techniques" | replace: "understanding", "Understanding" | replace_last: ".html", "" -%}
<section class="default-grid info" aria-label="Notice">
<p class="inner">
This is an unpublished editor’s draft that might include content that is not finalized.
<a href="https://www.w3.org/WAI/WCAG{{ version }}{{ pubSlug }}">View the published version</a>
</p>
</section>