govuk_tech_docs 6.4.0.beta → 6.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +15 -14
- data/.github/workflows/build-middleman-artifact.yaml +1 -1
- data/.github/workflows/check-documentation-updates.yaml +3 -2
- data/.github/workflows/check-gem-version.yaml +1 -1
- data/.github/workflows/npm-vulnerability-scanner.yaml +55 -0
- data/.github/workflows/pipeline.yaml +10 -4
- data/.github/workflows/publish-gem.yaml +1 -1
- data/.github/workflows/publish-github-pages.yaml +2 -2
- data/.github/workflows/ruby-vulnerability-scanner.yaml +44 -0
- data/.github/workflows/test.yaml +2 -1
- data/CHANGELOG.md +30 -1
- data/README.md +12 -21
- data/documentation/config/tech-docs.yml +15 -4
- data/documentation/source/configure_project/global_configuration/index.html.md.erb +64 -6
- data/documentation/source/maintain_project/use_latest_template/index.html.md.erb +2 -2
- data/documentation/source/publish_project/deploy/index.html.md.erb +6 -6
- data/documentation/source/write_docs/content/index.html.md.erb +18 -2
- data/lib/assets/stylesheets/_govuk_tech_docs.scss +1 -9
- data/lib/assets/stylesheets/modules/_technical-documentation.scss +4 -1
- data/lib/govuk_tech_docs/contribution_banner.rb +15 -3
- data/lib/govuk_tech_docs/version.rb +1 -1
- data/lib/govuk_tech_docs/warning_text_extension.rb +1 -1
- data/lib/govuk_tech_docs.rb +1 -4
- data/lib/source/layouts/_govuk_footer.erb +9 -0
- data/lib/source/layouts/_govuk_header.erb +17 -0
- data/lib/source/layouts/_service_navigation.erb +24 -24
- data/lib/source/layouts/core.erb +22 -5
- data/lib/tasks/lint.rake +87 -13
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/_index.import.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/_index.scss +2 -0
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_mixin.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/_feedback.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/_index.scss +5 -0
- data/node_modules/govuk-frontend/dist/govuk/components/feedback/_mixin.scss +48 -0
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_mixin.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/_index.import.scss +8 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/_index.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/_language-navigation.import.scss +6 -0
- data/node_modules/govuk-frontend/dist/govuk/components/language-navigation/_mixin.scss +68 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_mixin.scss +48 -3
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.mixin.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.mixin.scss +1 -0
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +16 -2
- data/package-lock.json +60 -60
- data/package.json +1 -1
- metadata +13 -2
- data/.github/workflows/dependency-review.yaml +0 -22
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 741a7042683c573724cdbab2c958d98306c55b0e81af89b9054952355a4a9268
|
|
4
|
+
data.tar.gz: a8a1cb466cdde9545ee2c8bdf46eb6c1e64d6a550f20073b6e9ad542d2aea189
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c494c002dd3830aee443bb3caee5cbd345cb6fbc3f7439e3bf7aac0a1ee5270ff67673e1930038a498f9158245bd2de38332d8e4d05bdc4ed75ca64291e432c
|
|
7
|
+
data.tar.gz: ee4d71a1692537a142a57fc65b579fb44d65799114509ff8bfc7d1370c8a1849e2201043d06af45089df6ae60afc60223cc1b5022f77d4f9f7351e523153bb33
|
data/.github/dependabot.yml
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
-
# package ecosystems to update and where the package manifests are located.
|
|
3
|
-
# Please see the documentation for all configuration options:
|
|
4
|
-
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
5
|
-
|
|
6
1
|
version: 2
|
|
7
2
|
updates:
|
|
8
3
|
# 1. Update Ruby dependencies (Gemfile/gemspec) in the root
|
|
@@ -12,9 +7,11 @@ updates:
|
|
|
12
7
|
interval: "weekly"
|
|
13
8
|
day: "monday"
|
|
14
9
|
time: "06:00"
|
|
10
|
+
# Essential for gem projects without a Gemfile.lock:
|
|
11
|
+
versioning-strategy: "increase"
|
|
15
12
|
commit-message:
|
|
16
13
|
prefix: chore
|
|
17
|
-
open-pull-requests-limit:
|
|
14
|
+
open-pull-requests-limit: 5
|
|
18
15
|
groups:
|
|
19
16
|
prod-safe-updates:
|
|
20
17
|
dependency-type: "production"
|
|
@@ -23,9 +20,15 @@ updates:
|
|
|
23
20
|
update-types:
|
|
24
21
|
- "minor"
|
|
25
22
|
- "patch"
|
|
23
|
+
dev-safe-updates:
|
|
24
|
+
dependency-type: "development"
|
|
25
|
+
patterns:
|
|
26
|
+
- "*"
|
|
27
|
+
update-types:
|
|
28
|
+
- "minor"
|
|
29
|
+
- "patch"
|
|
26
30
|
|
|
27
|
-
|
|
28
|
-
# 2. Update GitHub Actions (keeps your CI workflows secure)
|
|
31
|
+
# 2. Update GitHub Actions
|
|
29
32
|
- package-ecosystem: "github-actions"
|
|
30
33
|
directory: "/"
|
|
31
34
|
schedule:
|
|
@@ -39,15 +42,15 @@ updates:
|
|
|
39
42
|
patterns:
|
|
40
43
|
- "*"
|
|
41
44
|
|
|
45
|
+
# 3. Update npm dependencies
|
|
42
46
|
- package-ecosystem: "npm"
|
|
43
|
-
directory: "/"
|
|
47
|
+
directory: "/"
|
|
44
48
|
schedule:
|
|
45
49
|
interval: "weekly"
|
|
46
50
|
day: "monday"
|
|
47
51
|
time: "06:00"
|
|
48
|
-
open-pull-requests-limit:
|
|
52
|
+
open-pull-requests-limit: 5
|
|
49
53
|
groups:
|
|
50
|
-
# Group all "development" dependencies (linters, test runners, etc.)
|
|
51
54
|
dev-dependencies:
|
|
52
55
|
dependency-type: "development"
|
|
53
56
|
patterns:
|
|
@@ -55,12 +58,10 @@ updates:
|
|
|
55
58
|
update-types:
|
|
56
59
|
- "patch"
|
|
57
60
|
- "minor"
|
|
58
|
-
# Group all "production" dependencies (react, express, etc.)
|
|
59
|
-
# but ONLY for minor/patch versions to avoid breaking changes
|
|
60
61
|
prod-safe-updates:
|
|
61
62
|
dependency-type: "production"
|
|
62
63
|
patterns:
|
|
63
64
|
- "*"
|
|
64
65
|
update-types:
|
|
65
66
|
- "patch"
|
|
66
|
-
- "minor"
|
|
67
|
+
- "minor"
|
|
@@ -23,7 +23,7 @@ jobs:
|
|
|
23
23
|
with:
|
|
24
24
|
node-version-file: 'documentation/.nvmrc'
|
|
25
25
|
- name: Setup Ruby
|
|
26
|
-
uses: ruby/setup-ruby@
|
|
26
|
+
uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
|
|
27
27
|
with:
|
|
28
28
|
bundler-cache: true
|
|
29
29
|
working-directory: documentation
|
|
@@ -17,15 +17,16 @@ jobs:
|
|
|
17
17
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
18
18
|
with:
|
|
19
19
|
show-progress: false
|
|
20
|
+
fetch-depth: 2
|
|
20
21
|
|
|
21
|
-
- uses: ruby/setup-ruby@
|
|
22
|
+
- uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
|
|
22
23
|
with:
|
|
23
24
|
ruby-version: '3'
|
|
24
25
|
|
|
25
26
|
- name: Documentation updated
|
|
26
27
|
id: documentation_updated
|
|
27
28
|
run: |
|
|
28
|
-
if git diff --name-only
|
|
29
|
+
if git diff --name-only HEAD^ HEAD | grep -q '^documentation/'; then
|
|
29
30
|
echo "documentation-updated=true" >> $GITHUB_OUTPUT
|
|
30
31
|
else
|
|
31
32
|
echo "documentation-updated=false" >> $GITHUB_OUTPUT
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: NPM Audit Security Check
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
npm-audit:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout Code
|
|
15
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
|
16
|
+
|
|
17
|
+
- name: Setup Node.js
|
|
18
|
+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
|
|
19
|
+
with:
|
|
20
|
+
node-version: '20'
|
|
21
|
+
cache: 'npm'
|
|
22
|
+
|
|
23
|
+
- name: Run NPM Audit & Generate Summary
|
|
24
|
+
run: |
|
|
25
|
+
# 1. Run npm audit in JSON mode to capture raw audit metadata
|
|
26
|
+
AUDIT_JSON=$(npm audit --audit-level=high --json 2>/dev/null) || true
|
|
27
|
+
|
|
28
|
+
# 2. Extract counts using node's built-in JSON parser
|
|
29
|
+
CRITICAL_COUNT=$(echo "$AUDIT_JSON" | node -e "let d=''; process.stdin.on('data', c => d += c); process.stdin.on('end', () => { try { console.log(JSON.parse(d).metadata.vulnerabilities.critical || 0) } catch { console.log(0) } })")
|
|
30
|
+
HIGH_COUNT=$(echo "$AUDIT_JSON" | node -e "let d=''; process.stdin.on('data', c => d += c); process.stdin.on('end', () => { try { console.log(JSON.parse(d).metadata.vulnerabilities.high || 0) } catch { console.log(0) } })")
|
|
31
|
+
|
|
32
|
+
# 3. Build GitHub Job Summary Markdown
|
|
33
|
+
echo "## 🛡️ NPM Dependency Audit Summary" >> $GITHUB_STEP_SUMMARY
|
|
34
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
35
|
+
|
|
36
|
+
if [ "$CRITICAL_COUNT" -eq 0 ] && [ "$HIGH_COUNT" -eq 0 ]; then
|
|
37
|
+
echo "✅ **No high or critical vulnerabilities found!** All JS packages passed security checks." >> $GITHUB_STEP_SUMMARY
|
|
38
|
+
else
|
|
39
|
+
echo "⚠️ **High/Critical Vulnerabilities Detected in npm Dependencies**" >> $GITHUB_STEP_SUMMARY
|
|
40
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
41
|
+
echo "| Vulnerability Severity | Total Count |" >> $GITHUB_STEP_SUMMARY
|
|
42
|
+
echo "| :--- | :--- |" >> $GITHUB_STEP_SUMMARY
|
|
43
|
+
echo "| 🔴 **Critical** | $CRITICAL_COUNT \vert{}" >> $GITHUB_STEP_SUMMARY
|
|
44
|
+
echo "| 🟠 **High** | $HIGH_COUNT \vert{}" >> $GITHUB_STEP_SUMMARY
|
|
45
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
46
|
+
echo "### Detailed Audit Report" >> $GITHUB_STEP_SUMMARY
|
|
47
|
+
echo '```text' >> $GITHUB_STEP_SUMMARY
|
|
48
|
+
# Output human-readable audit text into the summary block
|
|
49
|
+
npm audit --audit-level=high 2>/dev/null || true
|
|
50
|
+
echo '```' >> $GITHUB_STEP_SUMMARY
|
|
51
|
+
|
|
52
|
+
# 4. Fail the workflow step
|
|
53
|
+
echo "::error::npm audit detected $CRITICAL_COUNT critical and $HIGH_COUNT high vulnerabilities."
|
|
54
|
+
exit 1
|
|
55
|
+
fi
|
|
@@ -6,13 +6,19 @@ on:
|
|
|
6
6
|
branches: [ "main"]
|
|
7
7
|
|
|
8
8
|
jobs:
|
|
9
|
-
|
|
10
|
-
uses: ./.github/workflows/
|
|
9
|
+
npm-vulnerability-scanner:
|
|
10
|
+
uses: ./.github/workflows/npm-vulnerability-scanner.yaml
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
ruby-vulnerability-scanner:
|
|
15
|
+
needs: npm-vulnerability-scanner
|
|
16
|
+
uses: ./.github/workflows/ruby-vulnerability-scanner.yaml
|
|
11
17
|
permissions:
|
|
12
18
|
contents: read
|
|
13
19
|
|
|
14
20
|
test:
|
|
15
|
-
needs:
|
|
21
|
+
needs: ruby-vulnerability-scanner
|
|
16
22
|
uses: ./.github/workflows/test.yaml
|
|
17
23
|
permissions:
|
|
18
24
|
contents: read # Allows the action to check out your repository code
|
|
@@ -42,7 +48,7 @@ jobs:
|
|
|
42
48
|
|
|
43
49
|
publish-github-pages:
|
|
44
50
|
needs: check-documentation-updates
|
|
45
|
-
if: github.event_name == 'push' && needs.check-documentation-updates.outputs.documentation-updated == 'true'
|
|
51
|
+
if: always() && github.event_name == 'push' && needs.check-documentation-updates.result == 'success' && needs.check-documentation-updates.outputs.documentation-updated == 'true'
|
|
46
52
|
uses: ./.github/workflows/publish-github-pages.yaml
|
|
47
53
|
permissions:
|
|
48
54
|
contents: read
|
|
@@ -35,7 +35,7 @@ jobs:
|
|
|
35
35
|
node-version-file: '.nvmrc'
|
|
36
36
|
cache: 'npm'
|
|
37
37
|
|
|
38
|
-
- uses: ruby/setup-ruby@
|
|
38
|
+
- uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
|
|
39
39
|
with:
|
|
40
40
|
ruby-version: '3'
|
|
41
41
|
bundler-cache: true
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
name: Publish GitHub pages
|
|
2
2
|
on:
|
|
3
3
|
workflow_call:
|
|
4
|
-
|
|
4
|
+
workflow_dispatch:
|
|
5
5
|
|
|
6
6
|
permissions:
|
|
7
7
|
contents: read
|
|
@@ -35,4 +35,4 @@ jobs:
|
|
|
35
35
|
path: "build"
|
|
36
36
|
- name: Deploy to GitHub Pages
|
|
37
37
|
id: deployment
|
|
38
|
-
uses: actions/deploy-pages@
|
|
38
|
+
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Ruby vulnerability scanner
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
bundler-audit:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout Code
|
|
15
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
|
|
16
|
+
|
|
17
|
+
- name: Setup Ruby
|
|
18
|
+
uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8
|
|
19
|
+
with:
|
|
20
|
+
ruby-version: '3.3'
|
|
21
|
+
bundler-cache: true
|
|
22
|
+
|
|
23
|
+
- name: Run Audit Check
|
|
24
|
+
run: |
|
|
25
|
+
gem install bundler-audit
|
|
26
|
+
|
|
27
|
+
# Run audit and save output to file (preventing immediate job failure via || true)
|
|
28
|
+
bundle-audit check --update > audit_results.txt || AUDIT_EXIT_CODE=$?
|
|
29
|
+
|
|
30
|
+
echo "## 🛡️ Ruby Dependency Audit Summary" >> $GITHUB_STEP_SUMMARY
|
|
31
|
+
|
|
32
|
+
if [ -z "$AUDIT_EXIT_CODE" ]; then
|
|
33
|
+
echo "::notice::No vulnerabilities found in Ruby dependencies."
|
|
34
|
+
echo "✅ **No vulnerabilities found!** All resolved gems from your `.gemspec` passed security checks." >> $GITHUB_STEP_SUMMARY
|
|
35
|
+
else
|
|
36
|
+
echo "⚠️ **Vulnerabilities Detected in Ruby Dependencies**" >> $GITHUB_STEP_SUMMARY
|
|
37
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
38
|
+
echo '```text' >> $GITHUB_STEP_SUMMARY
|
|
39
|
+
cat audit_results.txt >> $GITHUB_STEP_SUMMARY
|
|
40
|
+
echo '```' >> $GITHUB_STEP_SUMMARY
|
|
41
|
+
|
|
42
|
+
# Fail the step if vulnerabilities were found
|
|
43
|
+
exit $AUDIT_EXIT_CODE
|
|
44
|
+
fi
|
data/.github/workflows/test.yaml
CHANGED
|
@@ -2,6 +2,7 @@ name: Test
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
workflow_call:
|
|
5
|
+
workflow_dispatch:
|
|
5
6
|
|
|
6
7
|
permissions:
|
|
7
8
|
contents: read # Allows the action to check out your repository code
|
|
@@ -32,7 +33,7 @@ jobs:
|
|
|
32
33
|
node-version-file: '.nvmrc'
|
|
33
34
|
cache: 'npm'
|
|
34
35
|
|
|
35
|
-
- uses: ruby/setup-ruby@
|
|
36
|
+
- uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
|
|
36
37
|
with:
|
|
37
38
|
ruby-version: ${{ matrix.ruby }}
|
|
38
39
|
bundler-cache: true
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
## Unreleased changes
|
|
2
2
|
|
|
3
|
-
## 6.
|
|
3
|
+
## 6.5.0
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- **potentially breaking**: `enable_govuk_components` has been removed from the config as these are now required for the header and footer. If you are using this value for custom code or templates you should address this before updating.
|
|
8
|
+
- added config settings:
|
|
9
|
+
- `product_name`
|
|
10
|
+
- `headerContainerClasses`
|
|
11
|
+
- `headerClasses`
|
|
12
|
+
- `navigationContainerClasses`
|
|
13
|
+
- `navigationClasses`
|
|
14
|
+
|
|
15
|
+
[Check the documentation](https://design-system.service.gov.uk/components/header/) to see if you should add this value into your site.
|
|
16
|
+
|
|
17
|
+
- updated header and footer layouts to use components
|
|
18
|
+
|
|
19
|
+
### Deprecation warning
|
|
20
|
+
|
|
21
|
+
- `show_govuk_logo:` setting will be removed in v7.x.x in to be replaced by the generic header and custom logo settings
|
|
22
|
+
- `warning_text` custom extension will be removed in v7.x.x. This was [marked as deprecated on 1st June 2026](https://github.com/alphagov/tech-docs-gem/commit/304230ba9c49759471a9a8f2daa425e37f846364#diff-2a7ef696e418f6044e5b18ae22c9cff4cac18481ae6fd0c1360ef978087b6cc9R8-R9). You should now [use the GOV.UK warning text component](https://alphagov.github.io/tech-docs-gem/write_docs/content/#use-the-gov-uk-design-system).
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 6.4.1
|
|
27
|
+
|
|
28
|
+
- Bugfix: [Issue 283](https://github.com/alphagov/tech-docs-gem/issues/283) - correctly read report issue url (backwards compatible)
|
|
29
|
+
- Update: [Issue 543](https://github.com/alphagov/tech-docs-gem/issues/543) - allow full git urls as well as just repository name for report issue url
|
|
30
|
+
- [PR 542](https://github.com/alphagov/tech-docs-gem/pull/542) to improve vale linter handling and output when using rake task
|
|
31
|
+
|
|
32
|
+
## 6.4.0.beta
|
|
4
33
|
|
|
5
34
|
- [Remove govuk wrapper class](https://github.com/alphagov/tech-docs-gem/pull/530) that introduced extra padding
|
|
6
35
|
- Update[ template html syntax](https://github.com/alphagov/tech-docs-gem/pull/520) to more closely match gov.uk design template
|
data/README.md
CHANGED
|
@@ -45,6 +45,9 @@ The linting job can take the following optional parameters:
|
|
|
45
45
|
| `clean_build` | If true runs `bundle exec middleman build` to create a clean build. | 'true' |
|
|
46
46
|
| `full_output` | If true the full report is printed to the console, otherwise only the summary is displayed. | 'true' |
|
|
47
47
|
|
|
48
|
+
|
|
49
|
+
If running the linter causes timeouts or crashes, you can use `bundle exec tech_docs_jobs lint:debug`. You should use this locally, not as part of a pipeline.
|
|
50
|
+
|
|
48
51
|
## GOV.UK frontend
|
|
49
52
|
|
|
50
53
|
This gem uses [GOV.UK Frontend](https://github.com/alphagov/govuk-frontend), part of
|
|
@@ -156,38 +159,26 @@ refer to this [list of possible fixes](#issue-with-ffi-on-osx-mohave).
|
|
|
156
159
|
For more information on previewing your documentation locally, see
|
|
157
160
|
the [Tech Docs template documentation on previewing your documentation](https://alphagov.github.io/tech-docs-gem/create_project/preview/#preview-your-documentation).
|
|
158
161
|
|
|
159
|
-
## Tests
|
|
160
162
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
You can run the Ruby test suite with the following command:
|
|
163
|
+
## Linting
|
|
164
164
|
|
|
165
|
-
|
|
166
|
-
bundle exec rake spec
|
|
167
|
-
```
|
|
165
|
+
You should run the linter before pushing any changes to GitHub to check for errors and correct formatting. You can run linter jobs for ruby by running `bundle exec rubocop`. If you would like the linter to try and automatically fix any errors use `bundle exec rubocop -a`.
|
|
168
166
|
|
|
169
|
-
|
|
167
|
+
You can lint javascript files with the command `npm run lint`. If only want to see the final result and not the full output, use `npm run lint --silent`.
|
|
170
168
|
|
|
171
|
-
You can
|
|
169
|
+
You can also use the `Rakefile` job to run both together by running `bundle exec rake lint`. See the [Rakefile](./Rakefile) for more detail.
|
|
172
170
|
|
|
173
|
-
|
|
174
|
-
bundle exec rubocop
|
|
175
|
-
```
|
|
171
|
+
### Ruby tests
|
|
176
172
|
|
|
177
|
-
|
|
178
|
-
with:
|
|
173
|
+
You can run the Ruby test suite with the following command:
|
|
179
174
|
|
|
180
175
|
```shell
|
|
181
|
-
bundle exec
|
|
176
|
+
bundle exec rake spec
|
|
182
177
|
```
|
|
183
178
|
|
|
184
|
-
|
|
179
|
+
To test a specific file, use Rake's `SPEC` variable and set it to your filepath or directory. For example `bundle exec rake spec SPEC=spec/govuk_tech_docs/meta_tags_spec.rb`
|
|
185
180
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
```sh
|
|
189
|
-
bundle exec rake
|
|
190
|
-
```
|
|
181
|
+
### JavaScript tests
|
|
191
182
|
|
|
192
183
|
The JavaScript tests use the [Jasmine test framework][jas].
|
|
193
184
|
|
|
@@ -3,14 +3,25 @@ host: https://alphagov.github.io/tech-docs-gem
|
|
|
3
3
|
|
|
4
4
|
# Header-related options
|
|
5
5
|
show_govuk_logo: false
|
|
6
|
+
product_name:
|
|
6
7
|
service_name: Tech docs template
|
|
7
8
|
service_link: https://alphagov.github.io/tech-docs-gem
|
|
8
9
|
phase: Beta
|
|
9
10
|
|
|
10
|
-
# Uncomment if you do not want to activate the GOV.UK Design System component extension
|
|
11
|
-
enable_govuk_components: true
|
|
12
11
|
|
|
13
|
-
#
|
|
12
|
+
#These can be used to add custom classes to the GOV.UK header, footer and service navigation components. You can find more detail about these on the component documentation at:
|
|
13
|
+
#https://design-system.service.gov.uk/components/header/
|
|
14
|
+
#https://design-system.service.gov.uk/components/service-navigation/
|
|
15
|
+
#https://design-system.service.gov.uk/components/footer/
|
|
16
|
+
|
|
17
|
+
headerContainerClasses:
|
|
18
|
+
headerClasses:
|
|
19
|
+
navigationContainerClasses:
|
|
20
|
+
navigationClasses:
|
|
21
|
+
footerContainerClasses:
|
|
22
|
+
footerClasses:
|
|
23
|
+
|
|
24
|
+
# Links to show on service navigation below header
|
|
14
25
|
header_links:
|
|
15
26
|
Template: https://github.com/alphagov/tech-docs-template
|
|
16
27
|
Ruby gem: https://github.com/alphagov/tech-docs-gem
|
|
@@ -29,7 +40,7 @@ collapsible_nav: true
|
|
|
29
40
|
|
|
30
41
|
# Show links to contribute on GitHub
|
|
31
42
|
show_contribution_banner: true
|
|
32
|
-
github_repo: https://github.com/alphagov/tech-docs-gem
|
|
43
|
+
github_repo: https://github.com/alphagov/tech-docs-gem
|
|
33
44
|
|
|
34
45
|
# Enable search
|
|
35
46
|
enable_search: true
|
|
@@ -16,13 +16,23 @@ When you create your documentation project, the template creates a `tech-docs.ym
|
|
|
16
16
|
host:
|
|
17
17
|
|
|
18
18
|
# Header-related options
|
|
19
|
+
product_name: GOV.UK Product
|
|
19
20
|
show_govuk_logo: true
|
|
20
21
|
service_name: My First Service
|
|
21
22
|
service_link: https://www.larry-the-cat.service.gov.uk
|
|
22
23
|
phase: Beta
|
|
23
24
|
|
|
24
|
-
#
|
|
25
|
-
#
|
|
25
|
+
#These can be used to add custom classes to the GOV.UK header, footer and service navigation components. You can find more detail about these on the component documentation at:
|
|
26
|
+
#https://design-system.service.gov.uk/components/header/
|
|
27
|
+
#https://design-system.service.gov.uk/components/service-navigation/
|
|
28
|
+
#https://design-system.service.gov.uk/components/footer/
|
|
29
|
+
|
|
30
|
+
headerContainerClasses:
|
|
31
|
+
headerClasses:
|
|
32
|
+
navigationContainerClasses:
|
|
33
|
+
navigationClasses:
|
|
34
|
+
footerContainerClasses:
|
|
35
|
+
footerClasses:
|
|
26
36
|
|
|
27
37
|
# Links to show on right-hand-side of header
|
|
28
38
|
header_links:
|
|
@@ -56,7 +66,7 @@ github_repo: alphagov/YOUR_REPO
|
|
|
56
66
|
github_branch: main
|
|
57
67
|
```
|
|
58
68
|
|
|
59
|
-
<%=
|
|
69
|
+
<%= govukWarningText({text: "All of these settings are optional. However, you should enable or disable settings to increase the usability of your documentation or because of best practice.", iconFallbackText: "Warning"}) %>
|
|
60
70
|
|
|
61
71
|
You must wrap a value in quotes if it contains a colon, unless the value is a URL. For example:
|
|
62
72
|
|
|
@@ -88,6 +98,18 @@ Enables and disables the GOV.UK crown logo in the top left corner of the site. D
|
|
|
88
98
|
show_govuk_logo: true
|
|
89
99
|
```
|
|
90
100
|
|
|
101
|
+
<%= govukWarningText({text: "This setting is deprecated and will be replaced in version 7 by the generic header and custom logo options.", iconFallbackText: "Warning"}) %>
|
|
102
|
+
|
|
103
|
+
### product_name
|
|
104
|
+
|
|
105
|
+
Used for the `productName` value in the [GOV.UK header component](https://design-system.service.gov.uk/components/header/). It is used when the product name follows on directly from ‘GOV.UK’. For example, GOV.UK Pay or GOV.UK Design System. In most circumstances, you should use the Service navigation component.
|
|
106
|
+
|
|
107
|
+
```yaml
|
|
108
|
+
product_name: "Great new product"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
91
113
|
### service_name
|
|
92
114
|
|
|
93
115
|
Defines the service name in the header. Defaults to "My First Service" if you do not define it when creating your project.
|
|
@@ -112,7 +134,35 @@ Defines the phase of the service that the documentation is attached to. Defaults
|
|
|
112
134
|
phase: "Beta"
|
|
113
135
|
```
|
|
114
136
|
|
|
115
|
-
###
|
|
137
|
+
### Header and footer custom styles
|
|
138
|
+
|
|
139
|
+
If you have set `show_gouk_logo` to `true`, the header, service navigation and footer will use GOV.UK components.
|
|
140
|
+
|
|
141
|
+
#### Container classes
|
|
142
|
+
|
|
143
|
+
Classes for the container, useful if you want to make the header fixed width. The container settings you can configure are:
|
|
144
|
+
|
|
145
|
+
- `headerContainerClasses:`
|
|
146
|
+
- `navigationContainerClasses:`
|
|
147
|
+
- `footerContainerClasses:`
|
|
148
|
+
|
|
149
|
+
```yaml
|
|
150
|
+
headerContainerClasses: "my-custom-container-style my-additional-styles"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
You can add custom classes to the components in the same way. The settings you can configure are:
|
|
154
|
+
|
|
155
|
+
- `headerClasses:`
|
|
156
|
+
- `navigationClasses:`
|
|
157
|
+
- `footerClasses:`
|
|
158
|
+
|
|
159
|
+
```yaml
|
|
160
|
+
footerClasses: "my-custom-footer-style"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
There is more detail on the [GOV.UK Design System](https://design-system.service.gov.uk/components) documentation site.
|
|
164
|
+
|
|
165
|
+
### Govuk components
|
|
116
166
|
|
|
117
167
|
The `tech-docs-gem` contains a custom extension to allow you to use [GOV.UK Design System components](https://design-system.service.gov.uk/components). You can include these in your content by creating a `ruby` codeblock, and calling the component as described in the GOV.UK Design System documentation. For example, you can include a [GOV.UK Button](https://design-system.service.gov.uk/components/button/):
|
|
118
168
|
|
|
@@ -123,7 +173,7 @@ The `tech-docs-gem` contains a custom extension to allow you to use [GOV.UK Desi
|
|
|
123
173
|
This would be a short introduction, but now we need a button!
|
|
124
174
|
|
|
125
175
|
|
|
126
|
-
|
|
176
|
+
<%= govukButton({
|
|
127
177
|
text: "Click me!"
|
|
128
178
|
}) %>
|
|
129
179
|
|
|
@@ -211,12 +261,20 @@ show_contribution_banner: true
|
|
|
211
261
|
|
|
212
262
|
### github_repo
|
|
213
263
|
|
|
214
|
-
Your documentation project's GitHub repository. You must
|
|
264
|
+
Your documentation project's GitHub repository. You must configure this if you have enabled [show_contribution_banner].
|
|
265
|
+
|
|
266
|
+
Set this to either the repository's `owner/name` or its full GitHub URL. Link to the repository itself, rather than a file or directory, because the contribution banner builds its links relative to this URL.
|
|
215
267
|
|
|
216
268
|
```yaml
|
|
217
269
|
github_repo: alphagov/example-repo
|
|
218
270
|
```
|
|
219
271
|
|
|
272
|
+
You can also use the full URL:
|
|
273
|
+
|
|
274
|
+
```yaml
|
|
275
|
+
github_repo: https://github.com/alphagov/example-repo
|
|
276
|
+
```
|
|
277
|
+
|
|
220
278
|
### github_branch
|
|
221
279
|
|
|
222
280
|
Your project's GitHub default branch name. You can change this if your default branch is not named main.
|
|
@@ -23,8 +23,8 @@ Fetching gem metadata from https://rubygems.org/.............
|
|
|
23
23
|
Fetching gem metadata from https://rubygems.org/.
|
|
24
24
|
Resolving dependencies.......
|
|
25
25
|
<...>
|
|
26
|
-
Fetching govuk_tech_docs
|
|
27
|
-
Installing govuk_tech_docs
|
|
26
|
+
Fetching govuk_tech_docs 6.4.1.0 (was 6.2.0)
|
|
27
|
+
Installing govuk_tech_docs 6.4.1.0 (was 6.2.0)
|
|
28
28
|
<...>
|
|
29
29
|
Bundle updated!
|
|
30
30
|
```
|
|
@@ -29,16 +29,16 @@ This method relies on adding a `Staticfile.auth` file to the `build` folder beca
|
|
|
29
29
|
|
|
30
30
|
1. In the command line, navigate to your local documentation repo.
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
2. If required, run `bundle exec middleman build` to create a `build` folder.
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
3. Create a new `Staticfile.auth` file in the `build` folder.
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
4. Go to the [Htpasswd Generator].
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
5. Complete the __Username__ and __Password__ fields, and select __Create .htpasswd file__.
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
6. Copy the generated username and password hash into the `Staticfile.auth` file and save.
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
7. Deploy your documentation site in line with your normal process.
|
|
43
43
|
|
|
44
44
|
<%= partial "partials/links" %>
|
|
@@ -110,6 +110,8 @@ You must include alt text for an image if the image has not been explained in su
|
|
|
110
110
|
|
|
111
111
|
## Insert a warning
|
|
112
112
|
|
|
113
|
+
<%= govukWarningText({text: "This setting is deprecated and will be removed in version 7. You should use the GOV.UK warning text component.", iconFallbackText: "Warning"}) %>
|
|
114
|
+
|
|
113
115
|
Use the warning text component when you need to warn users about something important, such as legal consequences of an action, or lack of action, that they might take.
|
|
114
116
|
|
|
115
117
|
This warning text format is consistent with the [GOV.UK Design System warning text][design-system].
|
|
@@ -117,12 +119,26 @@ This warning text format is consistent with the [GOV.UK Design System warning te
|
|
|
117
119
|
To insert a warning, use the following:
|
|
118
120
|
|
|
119
121
|
```ruby
|
|
120
|
-
|
|
122
|
+
<%= warning_text('insert warning text here') %>
|
|
121
123
|
```
|
|
122
124
|
|
|
125
|
+
|
|
123
126
|
## Use the GOV.UK Design System
|
|
124
127
|
|
|
125
|
-
Use [GOV.UK Design System](https://design-system.service.gov.uk/) elements in your documentation to ensure your content complies with accessibility regulations.
|
|
128
|
+
Use [GOV.UK Design System](https://design-system.service.gov.uk/) elements in your documentation to ensure your content complies with accessibility regulations. To use a component from the design system call the component function inside a ruby block. For example:
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
<%=
|
|
132
|
+
govukPhaseBanner({
|
|
133
|
+
tag: {
|
|
134
|
+
text: "Alpha"
|
|
135
|
+
},
|
|
136
|
+
html: 'This is a new service. Help us improve it and <a class="govuk-link" href="#">give your feedback by email</a>.'
|
|
137
|
+
})
|
|
138
|
+
%>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
You do not need to import the function using `from "govuk/components/{COMPONENT_NAME}/macro.njk" import {COMPONENT_NAME}`. The extension will do this automatically.
|
|
126
142
|
|
|
127
143
|
|
|
128
144
|
<%= partial "partials/links" %>
|
|
@@ -14,15 +14,7 @@ $govuk-new-link-styles: true;
|
|
|
14
14
|
@import "govuk/core";
|
|
15
15
|
@import "govuk/objects";
|
|
16
16
|
|
|
17
|
-
@import "govuk/components
|
|
18
|
-
@import "govuk/components/footer";
|
|
19
|
-
@import "govuk/components/header";
|
|
20
|
-
@import "govuk/components/service-navigation";
|
|
21
|
-
@import "govuk/components/inset-text";
|
|
22
|
-
@import "govuk/components/input";
|
|
23
|
-
@import "govuk/components/tag";
|
|
24
|
-
@import "govuk/components/skip-link";
|
|
25
|
-
@import "govuk/components/warning-text";
|
|
17
|
+
@import "govuk/components";
|
|
26
18
|
|
|
27
19
|
@import "govuk/utilities";
|
|
28
20
|
@import "govuk/overrides";
|