Created
November 17, 2019 23:15
-
-
Save zackproser/f7664d9bdf5d62bf8f761aee0059fd99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const glob = require('glob') | |
const path = require('path') | |
var getDynamicRoutes = function() { | |
return [].concat( | |
glob | |
.sync('*.md', { cwd: 'posts/' }) | |
.map((filepath) => `/software/${path.basename(filepath, '.md')}`), | |
glob | |
.sync('*.md', { cwd: 'blog/' }) | |
.map((filepath) => `/blog/${path.basename(filepath, '.md')}`) | |
) | |
} | |
var dynamicPaths = getDynamicRoutes() | |
module.exports = { | |
generate: { | |
routes: dynamicPaths | |
}, | |
mode: 'universal', | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment