跳转至

Hugo

基本用法

Force creating new site in non-empty directory:

hugo new site . --force

Add new page:

hugo new content/path/to/page.md

Live-reload:

hugo server -D -F --baseURL=http://www.example.com --liveReloadPort=80 --appendPort=false

Build:

hugo --config config.yaml,config-prod.yaml --cleanDestinationDir

klakegg/hugo Docker镜像

klakegg/hugo Tags | Docker Hub

Get shell access:

docker-compose run --rm --entrypoint="" hugo ash

Docsy

hugo new site . --force
git init
git submodule add https://github.com/google/docsy.git themes/docsy
echo 'theme = "docsy"' >> config.toml
git submodule update --init --recursive --depth=1
git -c http.proxy=socks5h://x.x.x.x:yyyy submodule update --init --recursive --depth=1

Configuration Example

baseURL: http://www.example.com/
defaultContentLanguage: zh-cn
hasCJKLanguage: true
title: Example
theme: docsy
module:
# https://gohugo.io/hugo-modules/configuration/#module-config-mounts
mounts:
    source: themes/docsy/assets/vendor/bootstrap/dist
    target: static/bootstrap
params:
    copyright: www.example.com