-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add redirect from /docs/[operator] to /operators/[operator]
- Loading branch information
1 parent
77f5cb2
commit 9fe1231
Showing
2 changed files
with
43 additions
and
0 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
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,20 @@ | ||
--- | ||
import { getCollection, getEntry, render } from "astro:content"; | ||
import StarlightPage from "@astrojs/starlight/components/StarlightPage.astro"; | ||
export async function getStaticPaths() { | ||
const operators = await getCollection("operators"); | ||
return operators.map((operator) => ({ | ||
params: { operator: operator.data.slug }, | ||
})); | ||
} | ||
const operator = await getEntry("operators", Astro.params.operator); | ||
--- | ||
|
||
<meta http-equiv="refresh" content={`0;url=/operators/${operator.data.slug}`} /> | ||
<meta name="robots" content="noindex" /> | ||
<StarlightPage frontmatter={{...operator.data, pagefind: false}}> | ||
<!-- exclude this page from pagefind indexing --> | ||
<p>Redirecting to <a href="/operators/{operator.data.slug}">/operators/{operator.data.slug}</a></p> | ||
</StarlightPage> |