关于hugo:Hugo-使用小结

Archetypes

archetypes 这个文件夹寄存的是内容模板,如果我的项目里没有任何文件,Hugo 会去主题文件里找。

hugo new posts/my-first-post.md

以上命令会创立文件 content/posts/my-first-post.md,会顺次寻找:

  1. archetypes/posts.md
  2. archetypes/default.md
  3. themes/my-theme/archetypes/posts.md
  4. 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, i18narchetypes 一个子项目

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理