Skip to content

Commit

Permalink
2.1 support: Reference variable for version in index pages
Browse files Browse the repository at this point in the history
  • Loading branch information
kfranqueiro committed Aug 7, 2024
1 parent dc04439 commit caf4aaf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions eleventy.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import compact from "lodash-es/compact";
import { copyFile } from "fs/promises";

import { CustomLiquid } from "11ty/CustomLiquid";
import { resolveDecimalVersion } from "11ty/common";
import {
actRules,
assertIsWcagVersion,
Expand Down Expand Up @@ -101,7 +102,7 @@ const understandingNav = await generateUnderstandingNavMap(principles, understan
// Declare static global data up-front so we can build typings from it
const globalData = {
version,
versionDecimal: version.split("").join("."),
versionDecimal: resolveDecimalVersion(version),
techniques, // Used for techniques/index.html
technologies, // Used for techniques/index.html
technologyTitles, // Used for techniques/index.html
Expand Down Expand Up @@ -263,7 +264,7 @@ export default function (eleventyConfig: any) {
!isGuidelineObsolete(flatGuidelines[this.page.fileSlug])
) {
if (process.env.WCAG_VERBOSE) {
const since = technique.obsoleteSince!.split("").join(".");
const since = resolveDecimalVersion(technique.obsoleteSince!);
console.warn(
`linkTechniques in ${this.page.inputPath}: ` +
`skipping obsolete technique ${id} (as of ${since})`
Expand Down
4 changes: 2 additions & 2 deletions techniques/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>

<title>All WCAG 2.2 Techniques | WAI | W3C</title>
<title>All WCAG {{ versionDecimal }} Techniques | WAI | W3C</title>
<link rel="stylesheet" href="https://w3.org/WAI/assets/css/style.css"/>
<link rel="stylesheet" type="text/css" href="base.css"/>
</head>
Expand Down Expand Up @@ -34,7 +34,7 @@
</aside>

<main id="main" class="main-content standalone-resource__main">
<h1 id="title" class="title p-name">Techniques for WCAG 2.2</h1>
<h1 id="title" class="title p-name">Techniques for WCAG {{ versionDecimal }}</h1>
<aside class="box">
<header class="box-h ">Summary</header>
<div class="box-i">
Expand Down
4 changes: 2 additions & 2 deletions understanding/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>

<title>Understanding WCAG 2.2 | WAI | W3C</title>
<title>Understanding WCAG {{ versionDecimal }} | WAI | W3C</title>
<link rel="stylesheet" href="https://w3.org/WAI/assets/css/style.css"/>
<link rel="stylesheet" type="text/css" href="base.css"/>
</head>
Expand All @@ -29,7 +29,7 @@

<main id="main" class="main-content standalone-resource__main">

<h1 id="title" class="title p-name">All WCAG 2.2 Understanding Docs</h1>
<h1 id="title" class="title p-name">All WCAG {{ versionDecimal }} Understanding Docs</h1>
<aside class="box">
<header class="box-h ">Summary</header>
<div class="box-i">
Expand Down

0 comments on commit caf4aaf

Please sign in to comment.