It’s not how to customize a Hugo theme but how to create a theme?
We’re still on the lookout for an exceptional blog or overview paper to complement our understanding of this topic. Stay tuned for updates!
The key words are “rethink”, “perspective”
Deploy a real-time interaction example
I choose our achived acsa-lab theme to continue developping.
1 2 3 4
| git clone [email protected]:swangeese/acsa-web.git acsa-web-test cd acsa-web-test git clone [email protected]:swangeese/acsa-static.git static hugo server --bind=222.195.72.221 --baseURL=http://222.195.72.221 -p 1313 -D -d ./public
|
If you close your firewall ufw status
, you can see your web online.
how to create a theme?
create empty theme[^1]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| $ tree themes/topdown themes/topdown |-- LICENSE |-- README.md |-- archetypes | `-- default.md |-- layouts | |-- 404.html | |-- _default | | |-- baseof.html | | |-- list.html | | `-- single.html | |-- index.html | `-- partials | |-- footer.html | |-- head.html | `-- header.html |-- static | |-- css | `-- js `-- theme.toml
|
Only the layouts/_default/baseof.html
is not empty
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| <!DOCTYPE html> <html> {{- partial "head.html" . -}} <body> {{- partial "header.html" . -}} <div id="content"> {{- block "main" . }}{{- end }} </div> {{- partial "footer.html" . -}} </body> </html>
|
这是一个基本的HTML文档结构,但它包含了一些使用Go语言中的HTML模板引擎的语法。
1 2
| cd /rep-root hugo server -t topdown --bind=222.195.72.221 --baseURL=http://222.195.72.221:1314 -D -d ../public_2
|
And the website is clean blank paper
Hugo page model

所以 homepage 点击 后会进入_default
的list.html
, 之后再点击会进入single.html
。
参考文献
[^1]: Creating a Hugo Theme From Scratch