nanoblog

Setup nanoblog

by nanoblog
-
May 28, 2024
-
1 min. read
Blog post thumbnail

Setup repository

Clone and install repository

git clone https://github.com/marvin-j97/nanoblog your-site-name
cd your-site-name
pnpm i
pnpm dev

Start development server

pnpm dev

Build and preview your site

pnpm build
pnpm preview

The resulting dist folder will contain your website.

Basic configuration

All configuration is done through the src/config.ts file.

There are some essential configuration options that you should definitely look into. In your code editor of choice, simply search for “SETUP:”, that will show you a list of configurations that require your attention.

Remove examples

If you want to get rid of the example posts, you can run:

rm -rf src/content/blog/*.md

Create new blog post

To create a new blog post, simply run:

pnpm post:create "My First Post"

Note how every blog post is prefixed by its Date (YYYY-MM-DD). This helps keeping a chronological order in the file tree, however it is not strictly required. The post’s slug can be directly set in the posts frontmatter section.


Tags