Nextein screenshot

Nextein

Author Avatar Theme by Elmasse
Updated: 9 Jan 2023
892 Stars

A static site generator with markdown + react for Next.js

Categories

Overview

nextein is a static site generator based in Next.js. It is a wrapper around Next.js that allows you to write static sites using markdown and React. It requires NodeJS v10.x+ to run nextein commands.

Features

  • Allows you to write static sites using markdown and React.
  • Supports dynamic routes and static generator functions.
  • Provides a fetcher method to retrieve posts and data from markdown files.
  • Allows you to customize the rendering of markdown elements using custom renderers.
  • Generates unique identifiers for each post and provides frontmatter object with post meta information.

Installation

To install the nextein theme, follow these steps:

  1. Create a project:

    mkdir my-site
    cd my-site
    npm init -y
    
  2. Install Dependencies:

    npm i nextein next react react-dom
    
  3. Add a next.config.js config file.

  4. Create pages/index.js.

  5. Create a markdown post entry under posts folder (e.g., posts/my-first-post.md).

  6. Add npm scripts to run dev mode to your package.json:

    "scripts": {
      "dev": "nextein dev"
    }
    
  7. Run the development server:

    npm run dev
    
  8. Open http://localhost:3000 in your browser.

  9. Add another npm script to your package.json to export the site:

    "scripts": {
      "build": "nextein build"
    }
    

Summary

nextein is a static site generator based on Next.js that allows you to build static sites using markdown and React. It provides features like dynamic routes, custom renderers, and a convenient fetcher method to retrieve posts and data from markdown files. With nextein, you can create powerful and customizable static sites efficiently.