Skip to content

Commit

Permalink
Docs(nuxt): Do not slice the first two chars of the file name (#3152)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirazul authored and erezrokah committed Jan 28, 2020
1 parent a3646ed commit a9b350d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion website/content/docs/nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}`),
};
});
Expand Down

0 comments on commit a9b350d

Please sign in to comment.