Directory Structure
Nextein follows Next
directory structure. As an overview, these are the relevant files and folders on a Nextein
project:
├── pages
│ ├── index.js
│ └── post.js
├── posts
│ └── hello.md
├── static
│ └── hello.png
├── .babelrc
├── next.config.js
└── package.json
/pages
The /pages
folder contains all Page Components. These components will be used as either the page that list a set of posts or render a single post.
Example
index.js
, post.js
, about.js
, contact.js
/posts
Stores all posts in markdown format. There is no need for an specific name convention. You can use whatever you want. In case you decide to use a date prefix it will be used and removed from the name property.
Example
hello-world.md
, 2017-08-10-post-with-date.md
, 01-first-post.md
/static
The static folder serves as a repository for any static content such as images, css, videos, etc.
Example
image.png
, custom.css
.babelrc
This file is used by Next to define customized configuration for babel
. This is optional.
next.config.js
The config file for Next
. It is mandatory and it should be defined with the Nextein
config wrapper.
Example
const { withNextein } = require('nextein/config')
module.exports = withNextein({
// place your next config in here!
})
package.json
This file is generated by npm
. It will define the scripts to run next
binaries for development, build and export among others.
Example
{
"scripts": {
"dev": "next",
"export": "next build && next export"
}
}