Skip to content

Commit

Permalink
redirect links
Browse files Browse the repository at this point in the history
  • Loading branch information
milldr committed Sep 5, 2024
1 parent 36c52a9 commit e46b1fc
Show file tree
Hide file tree
Showing 6 changed files with 475 additions and 16 deletions.
19 changes: 8 additions & 11 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const lightCodeTheme = require('prism-react-renderer').themes.vsDark;
const darkCodeTheme = require('prism-react-renderer').themes.nightOwl;
const fs = require('fs');
const path = require('path');
const { redirects } = require("./redirects");

// Define the directory containing your CSS files
const cssDirectory = path.resolve(__dirname, './src/css');
Expand Down Expand Up @@ -62,16 +63,6 @@ const config = {
[
'docusaurus-plugin-image-zoom', {},
],
[
'@docusaurus/plugin-client-redirects', {
redirects: [
{
from: '/reference-architecture',
to: '/learn'
}
],
},
],
[
'@docusaurus/plugin-ideal-image',
{
Expand Down Expand Up @@ -99,7 +90,13 @@ const config = {
{
DSN: '[email protected]/4507472203087872',
},
]
],
[
'@docusaurus/plugin-client-redirects',
{
redirects
},
],
],

presets: [
Expand Down
7 changes: 2 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions redirects.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const fs = require('fs');

function redirections() {
refarch = JSON.parse(fs.readFileSync('./redirects/refarch.json'));
docs = JSON.parse(fs.readFileSync('./redirects/docs.json'));

redirects = refarch.concat(docs);

return redirects;
}

module.exports = {
redirects: redirections()
};
6 changes: 6 additions & 0 deletions redirects/docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"from": "/reference-architecture",
"to": "/learn"
}
]
Loading

0 comments on commit e46b1fc

Please sign in to comment.