Skip to content

Commit

Permalink
Merge pull request #177 from dimitrov-d/main
Browse files Browse the repository at this point in the history
Add broken wiki link redirects
  • Loading branch information
dimitrov-d authored May 10, 2024
2 parents 59e1b35 + c476501 commit 99f8d02
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .vuepress/clientAppEnhance.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { defineClientConfig } from '@vuepress/client'

export default defineClientConfig({
enhance({ app, router, siteData }) {
router.beforeEach((to, from, next) => {
const redirectMap = {
'/build/2-web3-services.html#storage-bucket': '/web3-services/2-web3-storage.html#storage-bucket',
'/build/2-web3-services.html#web3-hosting': '/web3-services/3-web3-hosting.html',
'/build/3-apillon-api.html#web3-hosting-api': '/build/3-hosting-api.html',
'/build/3-apillon-api.html#web3-storage-api': '/build/2-storage-api.html',
'/build/3-apillon-api.html': '/build/1-apillon-api.html',
'/build/3-apillon-api.html#api-to-web3': '/build/1-apillon-api.html',
'/build/#concepts': '/web3-services/1-good-to-know.html#concepts',
'/build/2-web3-services.html#web3-storage': '/web3-services/2-web3-storage.html',
'/build/2-web3-services.html#nfts': '/web3-services/4-nfts.html',
'/build/#ipfs': '/web3-services/1-good-to-know.html#ipfs'
};
const redirectPath = redirectMap[to.fullPath];
if (redirectPath) {
next({ path: redirectPath });
} else {
next();
}
});
},
});
1 change: 1 addition & 0 deletions .vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default defineUserConfig({
componentsDir: path.resolve(__dirname, "./components"),
}) as any,
],
clientConfigFile: path.resolve(__dirname, './clientAppEnhance.js'),
});

//Generate Nav
Expand Down

0 comments on commit 99f8d02

Please sign in to comment.