跳至正文
红枫
文档导航

快速开始

本页目录

安装

使用 Homebrew

brew install honmaple/tap/snow

从源码安装

go install github.com/honmaple/snow@latest

手动编译

git clone https://github.com/honmaple/snow --depth=1
cd snow
go mod tidy
go build .

创建站点

snow init [目录名]

示例:

$ snow init myblog
Welcome to snow 0.1.7.
> Where do you want to create your new web site? [.] myblog
> What will be the title of this web site? [snow]
> Who will be the author of this web site? honmaple
> What is your URL prefix? (no trailing slash) [http://example.com]
> Do you want to create first page? [Y/n]

初始化后生成:

myblog/
├── config.yaml
├── content/
│   └── posts/
│       └── hello-snow.md

预览站点

cd myblog
snow server --autoload

如果不想切换目录,也可以指定站点根目录:

snow server --root-dir myblog --autoload

构建站点

snow build

常见生产构建:

snow build --mode publish --clean 

更多命令和参数见 命令行使用。

下一步