💻 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
pnpm
1.1 Install Node.js
Check if Node.js is installed by running:
node --version
If 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
nvm
for version management - Windows: Use
fvm
1.2 Install Git
Make sure Git is installed before cloning the repository:
git --version
If 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.git
1.4 Install pnpm
SuzuBlog uses pnpm
as the package manager. To check if it’s installed:
pnpm --version
If it's not installed, you can install it using corepack
:
npm install --global corepack@latest
corepack enable pnpm
For more help, see the official docs:
2. Install Dependencies
In the project directory, run:
pnpm install
3. Start the Local Development Server
To launch the development environment:
pnpm dev
Then 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 start
Visit http://localhost:3000
again to view the result.
5. Additional Commands
Lint your code:
bashpnpm lint
Auto-fix code style issues:
bashpnpm lint:fix