Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Commit 15320ee

Browse files
~ . ~aj-stein-gsa
authored andcommitted
Update theme submod for GSA/uswds-hugo#267 changes
create 508 compliance workflow Update 508-compliance.yml update workflow Update foot.html add accessability css
1 parent 9f0cd6c commit 15320ee

File tree

7 files changed

+158
-2
lines changed

7 files changed

+158
-2
lines changed
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: 508 Compliance
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
- "release/*"
9+
- "feature/*"
10+
workflow_dispatch:
11+
inputs:
12+
linkcheck_fail_on_error:
13+
description: 'A boolean flag that determines if bad links found by the link checker fail fast'
14+
required: false
15+
default: true
16+
type: boolean
17+
linkcheck_create_issue:
18+
description: 'Create new GitHub issue if broken links are found'
19+
required: false
20+
default: false
21+
type: boolean
22+
23+
env:
24+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
25+
INPUT_FAIL_ON_ERROR: ${{ github.event.inputs.linkcheck_fail_on_error || 'true' }}
26+
INPUT_ISSUE_ON_ERROR: ${{ github.event.inputs.linkcheck_create_issue || 'false' }}
27+
28+
jobs:
29+
build-and-push-website:
30+
name: Build, Push, and 508 Compliance Test
31+
runs-on: ubuntu-20.04
32+
env:
33+
BUILD_PATH: ./build
34+
permissions:
35+
contents: write
36+
steps:
37+
- name: Manage GH_TOKEN
38+
if: env.GH_TOKEN == ''
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
41+
run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
42+
43+
- name: Checkout Latest
44+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
45+
with:
46+
submodules: recursive
47+
48+
- name: Setup Swap Space
49+
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
50+
with:
51+
swap-size-gb: 10
52+
53+
- name: Set up NodeJS
54+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a
55+
with:
56+
node-version-file: '.nvmrc'
57+
cache: 'npm'
58+
cache-dependency-path: package-lock.json
59+
60+
- name: Setup Dependencies
61+
run: |
62+
# (Optional OSCAL commands omitted for brevity)
63+
npm install --loglevel verbose
64+
echo "$PWD/node_modules/.bin/" >> $GITHUB_PATH
65+
sudo snap install dart-sass
66+
67+
- name: Cache Hugo Modules
68+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
69+
with:
70+
path: /tmp/hugo_cache
71+
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
72+
restore-keys: |
73+
${{ runner.os }}-hugomod-
74+
75+
- name: Run Hugo
76+
run: |
77+
hugo -e staging --logLevel debug -d _site-test
78+
79+
- name: Zip Artifacts for Upload
80+
run: |
81+
zip ${{ runner.temp }}/website.zip -r _site-test
82+
83+
- name: Upload Generated Site
84+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
85+
with:
86+
name: website
87+
path: ${{ runner.temp }}/website.zip
88+
retention-days: 5
89+
90+
# === Begin 508 (accessibility) Compliance Testing using pa11y-ci via sitemap ===
91+
92+
- name: Serve site for 508 Compliance Test
93+
run: |
94+
# Serve the built site (_site-test) on port 8080
95+
npx http-server _site-test -p 8080 &
96+
sleep 5
97+
98+
- name: Install pa11y-ci
99+
run: npm install -g pa11y-ci
100+
101+
- name: Run pa11y-ci for 508 Compliance
102+
id: pa11y
103+
run: |
104+
# This command tells pa11y-ci to fetch all URLs from the sitemap,
105+
# excluding any URLs matching "/*.pdf", and use the settings in .pa11yci.
106+
pa11y-ci \
107+
--sitemap http://localhost:8080/sitemap.xml \
108+
--sitemap-find "https://automate.fedramp.gov" \
109+
--sitemap-replace "http://localhost:8080" \
110+
--sitemap-exclude "/*.pdf" \
111+
--config .pa11yci > pa11y_report.md
112+
echo "pa11y_exit_code=$?" >> $GITHUB_ENV
113+
114+
- name: Upload 508 Compliance Report
115+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
116+
with:
117+
name: pa11y-report
118+
path: pa11y_report.md
119+
retention-days: 5
120+
121+
- name: Fail on 508 Compliance Issues
122+
if: ${{ env.pa11y_exit_code != '0' }}
123+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
124+
with:
125+
script: |
126+
core.setFailed('508 compliance test failed; please review the pa11y report.')

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/node_modules
66
.vscode
77
.DS_Store
8+
pa11y_report.md

.pa11yci

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"defaults": {
3+
"standard": "WCAG2AA",
4+
"runners": ["axe"],
5+
"concurrency": 1
6+
},
7+
"urls": [
8+
"http://localhost:8080"
9+
]
10+
}

config/_default/hugo.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ params:
4141
sidenav:
4242
custom_css:
4343
- css/site.css
44+
- css/accessibility.css
4445
searchAffiliate: fedramp-automation
4546
# debug: true
4647
markup:

layouts/partials/foot.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div class="usa-identifier__container">
1212
<div> <a href="https://www.gsa.gov/" target="_blank"><img class="usa-footer-logo-img"
1313
src="https://fedramp.gov/assets/img/gsa-reversed-logo.svg" alt="GSA logo"></a> </div>
14-
<div class="usa-identifier__identity" aria-label="Agency description">
14+
<div class="usa-identifier__identity" role="region" aria-label="Agency description">
1515
<p class="usa-identifier__identity-domain">FedRAMP.gov</p>
1616
<p class="usa-identifier__identity-disclaimer"> <span aria-hidden="true">An </span> official website
1717
of the GSA’s <a

static/css/accessibility.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
/* Apply high contrast to specific elements */
3+
4+
.usa-nav__link:not(button) {
5+
color: #111 !important;
6+
}
7+
.usa-nav span ,
8+
.usa-nav button:not([aria-expanded="true"]) ,
9+
.usa-nav button:not([aria-expanded="true"]) {
10+
color: #111;
11+
}
12+
13+
14+
15+
/* Cookie notice with WCAG AA compliant contrast */
16+
#cookie-notice-accept.btn-primary {
17+
color: #004c82 !important;
18+
}

themes/uswds-hugo

Submodule uswds-hugo updated 51 files

0 commit comments

Comments
 (0)