This guide uses the static yiipress binary. It is the recommended way to use YiiPress because it includes the PHP runtime and native extensions.
mkdir myblog
cd myblogDownload the YiiPress binary from the latest GitHub release or workflow artifact and place it in this directory as yiipress (yiipress.exe on Windows):
cp /path/to/yiipress ./yiipress
chmod +x ./yiipressOn Windows, use yiipress.exe in the examples below.
Run:
./yiipress initThis creates content/config.yaml, content/navigation.yaml, and two starter collections. Edit content/config.yaml:
title: My Blog
description: A personal blog
base_url: https://example.com
languages: [en]
date_format: "F j, Y"
entries_per_page: 10
permalink: /:collection/:slug/
taxonomies:
- tags
- categoriesyiipress init creates a page collection for standalone pages and a blog collection for dated posts:
content/
├── page/
│ └── _collection.yaml
└── blog/
└── _collection.yaml
Create the post with the scaffold command:
./yiipress new "Hello World" --collection=blogThen edit the generated file in content/blog/. A typical post looks like this:
---
title: "Hello World"
tags:
- general
---
Welcome to my blog! This is my first post.
## What is YiiPress?
YiiPress is a static blog engine built on [Yii3](https://yiisoft.github.io/docs/guide/intro/what-is-yii.html). It is:
- Exceptionally fast
- File-based (no database)
- Extensible with pluginsUse the same command without --collection for a root-level page:
./yiipress new "About"A simple content/about.md page looks like this:
---
title: "About"
---
This is my personal blog where I write about programming.Edit content/navigation.yaml:
main:
- title: Home
url: /
- title: Blog
url: /blog/
- title: About
url: /about/./yiipress buildThis generates static HTML in the output/ directory:
output/
├── blog/
│ ├── feed.xml
│ ├── hello-world/
│ │ └── index.html
│ ├── rss.xml
│ └── index.html
├── about/
│ └── index.html
├── tags/
│ ├── general/
│ │ └── index.html
│ └── index.html
└── sitemap.xml
Start the dev server:
./yiipress serveOpen the URL printed by the command. The preview server rebuilds after content changes and refreshes the browser.
Include drafts and future-dated posts during development:
./yiipress build --drafts --futureUse multiple workers for faster builds:
./yiipress build --workers=4By default, YiiPress uses --workers=auto, which detects available CPU capacity and uses up to 4 workers automatically.
Disable cache for a clean build:
./yiipress build --no-cache- Add authors in
content/authors/— see Content - Customize permalinks — see Content
- Configure markdown extensions — see Configuration
- Link between posts using relative
.mdpaths — see Content - Learn about all build options — see Commands