💻 Local Development Guide
SuzuBlog can run without local development. However, if you'd like to preview how your articles will be rendered on the site before publishing, setting up a local development environment is recommended.
1. Environment & Tool Setup
You may skip any or all of the following steps if you're certain your local environment already meets the requirements:
Node.js >= 20
git
pnpm1.1 Install Node.js
Check if Node.js is installed by running:
node --versionIf you see a version like v22.0.0, you're good to go. Otherwise, please install Node.js.
We recommend using the latest LTS version:
- macOS/Linux: Use
nvmfor version management - Windows: Use
WSLor the installer directly
1.2 Install Git
Make sure Git is installed before cloning the repository:
git --versionIf the output looks like git version 2.40.0, Git is installed. If not, download it here:
1.3 Clone the Repository
Run the following command in your terminal to clone the project locally:
git clone https://github.com/your-username/your-repo-name.git1.4 Install pnpm
SuzuBlog uses pnpm as the package manager. To check if it’s installed:
pnpm --versionIf it's not installed, you can install it using corepack:
npm install --global corepack@latest
corepack enable pnpmFor more help, see the official docs:
2. Install Dependencies
In the project directory, run:
pnpm install3. Start the Local Development Server
To launch the development environment:
pnpm devThen visit http://localhost:3000 in your browser to preview the site.
4. Build & Preview Production Version
To simulate the production environment and preview the final build:
pnpm build
pnpm startVisit http://localhost:3000 again to view the result.
5. Additional Commands
Lint your code:
bashpnpm lintAuto-fix code style issues:
bashpnpm lint:fix