Skip to content

Commit

Permalink
fix docs builder and redirect (#2092)
Browse files Browse the repository at this point in the history
Signed-off-by: Fotis Nikolaidis <nikolaidis.fotis@gmail.com>
  • Loading branch information
fnikolai committed May 22, 2024
1 parent 04010cf commit 0487d23
Show file tree
Hide file tree
Showing 7 changed files with 868 additions and 911 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export SUPERDUPERDB_ARTIFACTS_DIR ?= ~/.cache/superduperdb/artifacts
.DEFAULT_GOAL := help

help: ## Display this help
@cat ./docs/api/banner.txt
@cat ./docs/static/banner.txt
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)


Expand Down
15 changes: 15 additions & 0 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,21 @@ const config = {
},
},
],
[
'@docusaurus/plugin-client-redirects',
{
createRedirects(existingPath) {
if (existingPath.includes('/docs')) {
// Redirect from /docs/docs/X to /docs/X
// This is to avoid broken links on existing sites that are pointing to superduper docs.
return [
existingPath.replace('/docs', '/docs/docs'),
];
}
return undefined; // Return a falsy value: no redirect created
},
},
],
],
scripts: [
{
Expand Down
1,743 changes: 837 additions & 906 deletions docs/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"dependencies": {
"@cmfcmf/docusaurus-search-local": "^1.1.0",
"@docusaurus/core": "3.0.0",
"@docusaurus/plugin-client-redirects": "3.0.0",
"@docusaurus/preset-classic": "3.0.0",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function HomepageHeader() {
<div className={styles.buttons}>
<Link
className="button button--secondary button--lg"
to="/docs/docs/intro"
to="docs/intro"
>
Read documentation
</Link>
Expand Down
10 changes: 10 additions & 0 deletions docs/static/banner.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
****************************************************************************
_____ _____ _____ ____
/ ____| | __ \ | __ \| _ \
| (___ _ _ _ __ ___ _ __| | | |_ _ _ __ ___ _ __| | | | |_) |
\___ \| | | | '_ \ / _ \ '__| | | | | | | '_ \ / _ \ '__| | | | _ <
____) | |_| | |_) | __/ | | |__| | |_| | |_) | __/ | | |__| | |_) |
|_____/ \__,_| .__/ \___|_| |_____/ \__,_| .__/ \___|_| |_____/|____/
| | | |
|_| |_|
****************************************************************************
6 changes: 3 additions & 3 deletions docs/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<meta charset="UTF-8" />
<meta
http-equiv="refresh"
content="0; url=docs/docs/intro"
content="0; url=docs/intro"
/>
<script type="text/javascript">
window.location.href = 'docs/docs/intro';
window.location.href = 'docs/intro';
</script>
<title>Your Site Title Here</title>
</head>
<body>
If you are not redirected automatically, follow this
<a href="docs/docs/intro">link</a>.
<a href="docs/intro">link</a>.
</body>
</html>

0 comments on commit 0487d23

Please sign in to comment.