如何配置的
GitHub Pages + HUGO + The Root’s Home 主题
配置Github Actions(gh-pages.yml),使得每次push到master后执行hugo命令更新网站。
(本地预览时用hugo server --minify
命令,跟 gh-pages.yml 中保持一致。)
Netlify CMS
按这个配置。
没什么用。
如何维护
同步代码
主题是子模块,所以git pull --recurse-submodules
。
发新文章
- 用git。
- 用Netlify CMS。
- 在这里配置CMS。
shortcodes
hugo可以用shortcodes扩展markdown,官方内置了这些,我们添加了下面这些:
video
{{<video src="/img/2020-09-09-猫-02.mp4" width="200px">}}
mermaid
→ 官方文档
{{<mermaid>}}
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
{{</mermaid>}}
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
gallery
→ 官方文档
{{<allery>}}
{{<igure src="/img/2021-05-27-launcher-1.webp" width="110px" caption="launcher-1">}}
{{<igure src="/img/2021-05-27-launcher-2.webp" width="110px" caption="launcher-2">}}
{{<igure src="/img/2021-05-27-launcher-3.webp" width="110px" caption="launcher-3">}}
{{<igure src="/img/2021-05-27-launcher-4.webp" width="110px" caption="launcher-4">}}
{{</gallery>}}
{{<load-photoswipe>}}