Browse Source

Use redirect generator for /discord redirect

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
pull/267/head
Tomas Slusny 1 month ago
parent
commit
3bcaec8847
3 changed files with 11 additions and 12 deletions
  1. 7
    3
      config-overrides.js
  2. 4
    6
      redirect.js
  3. 0
    3
      src/components/app.js

+ 7
- 3
config-overrides.js View File

@@ -127,8 +127,12 @@ const addSitePlugins = () => config => {
})
)

for (let key in redirectConfig.links) {
const link = redirectConfig.links[key]
for (let key in redirectConfig) {
if (!redirectConfig.hasOwnProperty(key)) {
continue
}

const link = redirectConfig[key]

config.plugins.push(
new HtmlWebpackPlugin({
@@ -136,7 +140,7 @@ const addSitePlugins = () => config => {
url: link
},
template: 'redirect.html',
filename: redirectConfig.prefix + '/' + key + '/index.html',
filename: key + '/index.html',
inject: false,
xhtml: false
})

+ 4
- 6
redirect.js View File

@@ -1,8 +1,6 @@
module.exports = {
prefix: 'redirect',
links: {
'launcher/discord': 'https://discord.gg/ArdAhnN',
'launcher/troubleshooting':
'https://github.com/runelite/runelite/wiki/Troubleshooting-problems-with-the-client'
}
discord: 'https://discord.gg/ArdAhnN',
'redirect/launcher/discord': 'https://discord.gg/ArdAhnN',
'redirect/launcher/troubleshooting':
'https://github.com/runelite/runelite/wiki/Troubleshooting-problems-with-the-client'
}

+ 0
- 3
src/components/app.js View File

@@ -7,8 +7,6 @@ import './app.scss'
import './hero.css'
import './layout.scss'
import Navigation from './navigation'
import links from '../_data/links'
import Redirect from './redirect'
import Loader from './loader'
import Async from './async'
import { getStargazers } from '../modules/git'
@@ -35,7 +33,6 @@ const App = ({
username={username}
/>
<Router>
<Redirect path="/discord" to={links.discord} />
<Async path="/" getComponent={() => import('../routes/home')} />
<Async path="/blog" getComponent={() => import('../routes/blog')} />
<Async

Loading…
Cancel
Save