安裝 Hugo#
1
2
3
4
5
| # (wsl)
# Distributor ID: Ubuntu
# Description: Ubuntu 20.04.4 LTS
# Release: 20.04
# Codename: focal
|
1
2
| $ wget https://github.com/gohugoio/hugo/releases/download/v0.101.0/hugo_0.101.0_Linux-64bit.deb
$ wget https://github.com/gohugoio/hugo/releases/download/v0.101.0/hugo_extended_0.101.0_Linux-64bit.deb
|
1
2
| $ sudo dpkg -i hugo_0.101.0_Linux-64bit.deb
$ sudo dpkg -i hugo_extended_0.101.0_Linux-64bit.deb
|
檢查是否成功#
1
2
3
4
5
6
| $ hugo version
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
$ hugo new site {project_name}
$ cd {project_name}
$ hugo server
|
1
2
3
| # in {project_name} root
$ git init
$ git clone https://github.com/adityatelange/hugo-PaperMod themes/PaperMod --depth=1
|
輸出 (上傳至 GitHub 為例)#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| # 產生靜態檔案
$ hugo
# 移出去
$ cp -r public ../
$ cd ../public
$ git init
# GitHub 開專案 名稱為 {你的GitHub ID}.github.io
# 新增遠端
$ git remote add origin https://github.com/{你的GitHub ID}/{你的GitHub ID}.github.io.git
# 推送
$ git push origin main
|
你的部落格就會在 www.{ID}.github.io
啦