Archetypes
archetypes
这个文件夹寄存的是内容模板,如果我的项目里没有任何文件,Hugo 会去主题文件里找。
hugo new posts/my-first-post.md
以上命令会创立文件 content/posts/my-first-post.md
,会顺次寻找:
archetypes/posts.md
archetypes/default.md
themes/my-theme/archetypes/posts.md
themes/my-theme/archetypes/default.md
my-theme
是应用的主题。
模板示例:
---title: "{{ replace .Name "-" " " | title }}"date: {{ .Date }}draft: true---
Content
所有文章的内容都寄存在 content
目录下。
Hugo Modules
Hugo 的模块能够是一个主我的项目,也能够是蕴含 static
, content
, layouts
, data
, assets
, i18n
和 archetypes
一个子项目