Next Static Blog 采用next.js开发的一个简单静态博客
Next Static Blog 采用next.js开发的一个简单静态博客
React 其它杂项
共107Star
详细介绍
Next Static Blog
A simple static blog powered by next.js.
Why
- I found other SSG (Static Site Generator) to be too much for what I need
- I wanted to be able to transition to a dynamic site easily if need be and next.js is a great existing SSR (Server Side Render) framework.
Usage
yarn
yarn run export
cd out
now
Adding a Post
- Create a
.js
file inposts
. - Export an object that contains post content/metadata
module.exports = {
title: 'Title',
slug: 'slug',
author: 'Your Name',
date: new Date().toString(),
tags: [
'tags',
'go here'
],
body: `
## Post
Use markdown to _write_ your post
Here's some code:
\`\`\`
const a = 'thing';
\`\`\`
`
};
- Inside
./posts/index.js
require your new post and add it to the exported array. - Re-run
yarn run export
to build your new site.
-
502 Star
-
34 Star
-
67 Star
-
409 Star
-
100 Star
-
2690 Star
-
747 Star
-
31240 Star
-
0 Star