← 返回命令列表

Linux command

zola 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Create a new site

zola init [site_name]

Build the site

zola build

Start development server

zola serve

Serve on specific port

zola serve -p [8080]

Build with custom output directory

zola build -o [public]

Check for errors without building

zola check

Check site structure, skipping external link validation

zola check --skip-external-links

Serve with auto-open in browser

zola serve --open

Initialize site in non-empty directory

zola init --force [site_name]

说明

Zola is a fast static site generator written in Rust. It combines content (Markdown files), templates (Tera templating), and configuration into a static website. The site structure includes: - content/ - Markdown files organized as sections - templates/ - Tera HTML templates - static/ - Static assets copied directly - themes/ - Optional downloadable themes - config.toml - Site configuration Zola features include syntax highlighting, automatic table of contents, taxonomies (tags, categories), shortcodes, and built-in Sass compilation. The development server provides live reload, rebuilding automatically when files change.

参数

-c, --config _file_
Path to config file (default: config.toml)
-r, --root _dir_
Site root directory
-o, --output-dir _dir_
Output directory for build
-p, --port _port_
Port for serve command (default: 1111)
-i, --interface _addr_
Interface to bind server (default: 127.0.0.1)
-u, --base-url _url_
Override base URL from config
--open
Automatically open site in browser (serve only)
--force
Overwrite existing output directory without prompting
--drafts
Include draft content
--skip-external-links
Skip external link validation (check only)

FAQ

What is the zola command used for?

Zola is a fast static site generator written in Rust. It combines content (Markdown files), templates (Tera templating), and configuration into a static website. The site structure includes: - content/ - Markdown files organized as sections - templates/ - Tera HTML templates - static/ - Static assets copied directly - themes/ - Optional downloadable themes - config.toml - Site configuration Zola features include syntax highlighting, automatic table of contents, taxonomies (tags, categories), shortcodes, and built-in Sass compilation. The development server provides live reload, rebuilding automatically when files change.

How do I run a basic zola example?

Run `zola init [site_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -c, --config _file_ do in zola?

Path to config file (default: config.toml)