generated from ministryofjustice/template-documentation-site
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to v5 of tech docs publisher and adopt lychee for the link che…
…cker (#30) * update to v4 of tech docs publisher The old link checker is no longer included, so use lychee instead. * fix: remove dead links from the readme The tech docs template's own documentation has been missing since GOV.UK decommissioned GOV.UK PaaS in 2023. See alphagov/tdt-documentation#210 * fix: simplify directory structure For the link checker to work, the directory structure must mirror the directory path structure of the final site. Since we had two parallel directory structures, `source`, containing erb, and `source/documentation`, containing markdown, and those structures were slightly inconsistent, we ended up in the case where a relative link in the markdown could not be resolved by the link checker, even though the link worked when the documentation was published. There is really no need to have a parallel file structure just to include markdown files. Middleman (which the tech docs template is based on) will happily mix erb files with the extension `.html.erb` or `.html.md.erb` and markdown files with the extension `.html.md`. In fact, we don't rely on erb at all, so we can just name our files `.html.md`. * Update to v5 and add phase banner Update the tech docs publisher to v5. This upgrades to govuk frontend v5.7.1.
- Loading branch information
Showing
14 changed files
with
87 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,39 @@ | ||
name: Check for broken links | ||
|
||
name: Build and Test | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- "source/**" | ||
branches: | ||
- main | ||
|
||
permissions: {} | ||
jobs: | ||
check_links: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ministryofjustice/tech-docs-github-pages-publisher:v3 | ||
image: ghcr.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:35699473dbeefeeb8b597de024125a241277ee03587d5fe8e72545e4b27b33f8 # v5.0.0 | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
- name: Build | ||
id: build | ||
run: | | ||
/usr/local/bin/package | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: htmlproofer | ||
run: /scripts/check-url-links.sh | ||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | ||
- name: Lychee | ||
id: lychee | ||
uses: lycheeverse/lychee-action@7cd0af4c74a61395d455af97419279d86aafaede # v2.0.2 | ||
with: | ||
args: --verbose --no-progress './**/*.md' './**/*.html' './**/*.erb' --exclude-loopback --accept 401,403,200,429 --exclude '^https://github.com/moj-analytical-services/create-a-derived-table' --fallback-extensions 'md,html.md.erb' | ||
fail: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,17 @@ | ||
IMAGE := ministryofjustice/tech-docs-github-pages-publisher:v3 | ||
IMAGE := ghcr.io/ministryofjustice/tech-docs-github-pages-publisher@sha256:35699473dbeefeeb8b597de024125a241277ee03587d5fe8e72545e4b27b33f8 # v5.0.0 | ||
|
||
# Use this to run a local instance of the documentation site, while editing | ||
.PHONY: preview check | ||
.PHONY: preview package | ||
|
||
preview: | ||
docker run --rm \ | ||
-v $$(pwd)/config:/app/config \ | ||
-v $$(pwd)/source:/app/source \ | ||
docker run --rm --platform=linux/amd64 \ | ||
-v $$(pwd)/config:/tech-docs-github-pages-publisher/config \ | ||
-v $$(pwd)/source:/tech-docs-github-pages-publisher/source \ | ||
-p 4567:4567 \ | ||
-it $(IMAGE) /scripts/preview.sh | ||
-it $(IMAGE) /usr/local/bin/preview | ||
|
||
deploy: | ||
docker run --rm \ | ||
-v $$(pwd)/config:/app/config \ | ||
-v $$(pwd)/source:/app/source \ | ||
-it $(IMAGE) /scripts/deploy.sh | ||
|
||
check: | ||
docker run --rm \ | ||
-v $$(pwd)/config:/app/config \ | ||
-v $$(pwd)/source:/app/source \ | ||
-it $(IMAGE) /scripts/check-url-links.sh | ||
package: | ||
docker run --rm --platform=linux/amd64 \ | ||
-v $$(pwd)/config:/tech-docs-github-pages-publisher/config \ | ||
-v $$(pwd)/source:/tech-docs-github-pages-publisher/source \ | ||
-it $(IMAGE) /usr/local/bin/package |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
source/documentation/glossary.md → source/glossary/index.html.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//= require govuk_frontend_all |