关于hugo:Hugo-使用小结

6次阅读

共计 452 个字符,预计需要花费 2 分钟才能阅读完成。

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 一个子项目

正文完
 0