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
7 changes: 7 additions & 0 deletions src/src/data/projects/engineering-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ docs:
# `Home.md` is the hub (`rootPage` above) and is published as the landing page.
exclude:
- _Sidebar.md
# A page's folder is part of its URL (ADR 0011), so `Dependency-Versions.md`
# publishes at `/docs/engineering-playbook/foundations/dependency-versions/`.
# The flat address is kept as an alias for anyone who looks for that page at
# the docs root: the build writes a meta-refresh redirect there, and only once
# the nested page it forwards to actually exists.
redirects:
dependency-versions: foundations/dependency-versions
related:
- build-sdk
- containers
Expand Down
14 changes: 14 additions & 0 deletions src/tests/unit/docs-redirects.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,20 @@ describe('moved documentation page redirects', () => {
).toEqual([['/docs/zodsharp/performance/', '/docs/zodsharp/quality/performance/']]);
});

test('the playbook keeps its docs-root dependency-versions address', () => {
// The page lives under its topic folder, which makes the folder part of the
// URL (ADR 0011), so the catalogue declares the docs-root address as an
// alias: a reader or a link that looks for `dependency-versions` at the
// project root lands on the page instead of a 404. The pair is only written
// while the nested page it forwards to is published.
expect(docsPageRedirects(projects)).toContainEqual({
from: '/docs/engineering-playbook/dependency-versions/',
to: '/docs/engineering-playbook/foundations/dependency-versions/',
title: 'This documentation page moved…',
message: 'The page now lives at its new address.',
});
});

test('a moved page is written as a redirect once its new address is published', () => {
const dist = mkdtempSync(join(tmpdir(), 'purview-redirects-'));
try {
Expand Down
Loading