How to use the nextein/config.withNextein function in nextein

To help you get started, we’ve selected a few nextein examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elmasse / nextein-starter / next.config.js View on Github external
const { withNextein } = require('nextein/config')

module.exports = withNextein({
  // your next.js config goes here
})
github elmasse / nextein-example / next.config.js View on Github external
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' },

nextein

A static site and blog generator based on Next.js

ISC
Latest version published 2 years ago

Package Health Score

48 / 100
Full package analysis