How to Build a Static Blog with YiiPress Engine in Minutes
This guide walks you through creating a new YiiPress Engine project, configuring site settings, adding collections, writing posts, setting up navigation, building the site, and previewing it locally with optional build flags.
YiiPress Engine is a static website and blog generator built on the Yii3 framework. It creates fast, file‑driven sites without a database.
1. Create a new project
composer create-project yiipress/engine myblog
cd myblog2. Configure the site
Edit content/config.yaml and set the basic site metadata and behavior:
title: 我的博客
description: 一个个人博客
base_url: https://example.com
language: zh-CN
date_format: "Y年m月d日"
entries_per_page: 10
permalink: /:collection/:slug/
taxonomies:
- tags
- categories3. Create a collection
Make a directory for the collection and define its properties in content/blog/_collection.yaml:
mkdir -p content/blog title: 博客
sort_by: date
sort_direction: desc
feed: true
listing: true4. Write the first article
Create a markdown file content/blog/2026-02-24-hello-world.md with front‑matter and content:
---
title: "你好,世界"
tags:
- 通用
---
欢迎来到我的博客!这是我的第一篇文章。
## 什么是 YiiPress?
YiiPress 是一款基于 Yii3 构建的静态博客引擎,具备以下特点:
- 极致速度
- 纯文件驱动(无需数据库)
- 支持插件扩展5. Create a standalone page
Example page content/about.md:
---
title: "关于"
---
这是我的个人博客,我会在这里分享编程相关的文章。6. Add a navigation menu
Define the menu in content/navigation.yaml:
main:
- title: 首页
url: /
- title: 博客
url: /blog/
- title: 关于
url: /about/7. Build the site
Run the build command. The generated static HTML files are placed under the output/ directory, with subfolders for blog posts, pages, tags, sitemap and RSS feeds.
make yii build8. Local preview
Start the development server and open the site in a browser: make up Visit http://localhost:8087 (the port can be changed in docker/.env).
Build options
Include drafts and future‑dated articles: make yii build -- --drafts --future Speed up with multiple workers: make yii build -- --workers=4 Force cache clean and rebuild: make yii build -- --no-cache For additional documentation see the repository at https://github.com/yiipress/engine/tree/master/docs.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Tech Hub
Sharing cutting-edge internet technologies and practical AI resources.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
