Skip to content

Commit b637b2e

Browse files
committed
fix: point signing-keys docs at our OpenPGP keys page
The embedded upstream signing-keys page duplicated /openpgp_keys/. The upstream doc is now excluded from the build, the old URL /software/rnp/docs/signing-keys/ is a redirect stub to /openpgp_keys/ (preserving any inbound links), and both docs sidebars (product page + DocsLayout) list 'PGP keys used for signing source code' as an off-docs link to the keys page. e2e: 29/29.
1 parent a47dc5c commit b637b2e

5 files changed

Lines changed: 46 additions & 3 deletions

File tree

src/content.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ const UPSTREAM_LINK_FIXES: [string, string][] = [
113113
const softwareDocs = defineCollection({
114114
loader: adocLoader({
115115
base: './vendor',
116-
include: (rel) => /^[^/]+\/(README\.adoc|docs\/.+\.adoc)$/.test(rel),
116+
// signing-keys.adoc is excluded: signing keys live on our own /openpgp_keys/ page.
117+
include: (rel) =>
118+
/^[^/]+\/(README\.adoc|docs\/.+\.adoc)$/.test(rel) &&
119+
!rel.endsWith('docs/signing-keys.adoc'),
117120
idFromRel: (rel) => {
118121
const parts = rel.split('/');
119122
const product = parts[0];

src/layouts/DocsLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const { title, description, product, productTitle, docs, currentSlug } = Astro.p
4141
{
4242
docs.map((doc) => (
4343
<a
44-
href={`/software/${product}/docs/${doc.slug}/`}
44+
href={doc.slug.startsWith('/') ? doc.slug : `/software/${product}/docs/${doc.slug}/`}
4545
class:list={[
4646
'block rounded-md px-3 py-2 font-sans text-sm transition-colors',
4747
doc.slug.includes('/') && 'pl-6',

src/pages/software/[id].astro

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ const docs = (await getCollection('softwareDocs'))
2929
.filter((d) => d.data.product === entry.id)
3030
.map((d) => ({ slug: d.id.split('/').slice(1).join('/'), title: d.data.title }))
3131
.sort((a, b) => docSort(a.slug, b.slug));
32+
// Signing keys live on the site's own OpenPGP keys page, not in the repo docs.
33+
if (entry.id === 'rnp') {
34+
docs.push({ slug: '/openpgp_keys/', title: 'PGP keys used for signing source code ↗' });
35+
}
3236
---
3337

3438
<BaseLayout title={data.title} description={data.description}>
@@ -91,7 +95,7 @@ const docs = (await getCollection('softwareDocs'))
9195
<nav class="mt-4">
9296
{docs.map((doc) => (
9397
<a
94-
href={`/software/${entry.id}/docs/${doc.slug}/`}
98+
href={doc.slug.startsWith('/') ? doc.slug : `/software/${entry.id}/docs/${doc.slug}/`}
9599
class="block py-1.5 font-sans text-sm text-muted transition-colors hover:text-accent"
96100
>
97101
{doc.title}

src/pages/software/[product]/docs/[...slug].astro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ const docs = (await getCollection('softwareDocs'))
3636
.filter((d) => d.data.product === product)
3737
.map((d) => ({ slug: d.id.split('/').slice(1).join('/'), title: d.data.title }))
3838
.sort((a, b) => docSort(a.slug, b.slug));
39+
// Signing keys live on the site's own OpenPGP keys page, not in the repo docs.
40+
if (product === 'rnp') {
41+
docs.push({ slug: '/openpgp_keys/', title: 'PGP keys used for signing source code ↗' });
42+
}
3943
4044
const { Content } = await render(entry);
4145
---
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
// The upstream signing-keys doc is superseded by our own OpenPGP keys page.
3+
---
4+
5+
<!doctype html>
6+
<html lang="en">
7+
<head>
8+
<meta charset="utf-8" />
9+
<meta name="viewport" content="width=device-width, initial-scale=1" />
10+
<meta name="robots" content="noindex" />
11+
<meta http-equiv="refresh" content="0; url=/openpgp_keys/" />
12+
<link rel="canonical" href="https://www.rnpgp.org/openpgp_keys/" />
13+
<title>Moved — RNP</title>
14+
<style>
15+
body {
16+
margin: 0;
17+
min-height: 100vh;
18+
display: grid;
19+
place-items: center;
20+
font-family: ui-monospace, monospace;
21+
background: #f8fbfe;
22+
color: #23273a;
23+
}
24+
a {
25+
color: #1a7bec;
26+
}
27+
</style>
28+
</head>
29+
<body>
30+
<p>This page has moved — <a href="/openpgp_keys/">OpenPGP keys</a></p>
31+
</body>
32+
</html>

0 commit comments

Comments
 (0)