diff --git a/website/content/docs/nuxt.md b/website/content/docs/nuxt.md index c2431ddc..43783fa7 100644 --- a/website/content/docs/nuxt.md +++ b/website/content/docs/nuxt.md @@ -247,9 +247,10 @@ export default { generate: { routes: function() { const fs = require('fs'); + const path = require('path'); return fs.readdirSync('./assets/content/blog').map(file => { return { - route: `/blog/${file.slice(2, -5)}`, // Remove the .json from the end of the filename + route: `/blog/${path.parse(file).name}`, // Return the slug payload: require(`./assets/content/blog/${file}`), }; });