Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const { withNextein } = require('nextein/config')
module.exports = withNextein({
// your next.js config goes here
})
const { entries, inCategory } = require('nextein/posts')
const getStories = async () => {
const category = 'stories'
const all = await entries()
return all
.filter(inCategory(category, {includeSubCategories: true}))
.map(post => post.data.category)
.filter((category, idx, arr) => arr.indexOf(category) === idx )
.reduce((prev, entry) => ({
...prev,
[`/${entry.replace(`${category}/`, '')}`]: { page: '/stories', query: { category: `${entry}` } }
}), {})
}
module.exports = withNextein({
nextein: config => {
config.plugins = [
{
name: 'nextein-plugin-markdown',
options: {
rehype: ['rehype-slug', 'rehype-autolink-headings']
}
}
]
return config
},
exportPathMap: async (defaultPathMap) => {
const stories = await getStories()
return ({
'/simple': { page: '/simple' },