Hugo 不僅是個 CLI,更是一個 Framework,當使用 hego new site 建立一新站台後,他會自動建立一些預設目錄與檔案。
Version
Hugo 0.147.8
Folder Structure
hugo-lab
├── archetypes
├── assets
├── content
├── data
├── i18n
├── layouts
├── static
├── themes
├── public
└─── hugo.json
- archetypes : 放置
hugo new content時所採用的預設 Markdown Template,可自行加上客製化的 Front Matter - assets:放置要經過 Hugo pipe 壓縮的檔案,如自己寫的 CSS 與 JavaScript
- content : 放置 markdown
- data : 放置本地 JSON 檔
- i18n:放置多國語言檔
- layouts : 放置本地的 template
- static : 放置不需經過 Hugo pipe 處理的檔案,Hugo 只會做單純 copy 到
public目錄,如由 NPM 安裝的套件,可將其放在static目錄下 - themes : 放置 theme 的 template
- public : Hugo 編譯過的 HTML/CSS/JavaScript
- hugo.json : Hugo 設定檔
Conclusion
- Hugo 詳細定義其目錄架構,方便團隊合作與了解其他 theme