Hugo初试
约 179 字
预计阅读 1 分钟
安装
安装choco
1
2
| Set-ExecutionPolicy Bypass -Scope Process
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
安装hugo
1
| choco install hugo-extended -confirm
|
基本使用
创建新站
初始化git
安装主题Book
1
2
| git submodule add https://github.com/alex-shpak/hugo-book themes/book
hugo server --minify --theme book
|
创建新文章
hugo new posts/hugo.md
启动服务器
hugo server -D
hugo-book主题开启KaTeX、Mermaid
1
2
3
4
| # Needed for mermaid/katex shortcodes
[markup]
[markup.goldmark.renderer]
unsafe = true
|
hugo-book启用中文搜索
1
2
3
4
5
6
7
| languageCode = "cn"
defaultContentLanguage = 'cn'
[languages]
[languages.cn]
languageName = 'Chinaese'
contentDir = 'content'
weight = 1
|