Redirect dev pages

This commit is contained in:
Misode
2020-09-12 00:18:23 +02:00
parent 01f5be3b39
commit e815888d0f
2 changed files with 12 additions and 1 deletions

View File

@@ -337,8 +337,14 @@ Promise.all([
if (!target.endsWith('/')) {
target = `${target}/`
}
if (target.startsWith('/dev/')) {
reload(target.slice(4))
return
}
if (track) {
ga('set', 'page', target.replace(/^\/dev/, ''))
ga('set', 'page', target)
ga('send', 'pageview');
history.pushState(target, 'Change Page', target)
}

View File

@@ -40,6 +40,11 @@ module.exports = (env, argv) => ({
filename: 'index.html',
template: 'src/index.html'
}),
new HtmlWebpackPlugin({
title: 'Data Pack Generators Minecraft',
filename: '404.html',
template: 'src/index.html'
}),
...config.models.flatMap(buildModel)
]
})