Hugo 新增一篇文章
front matter
- 用hugo new建立新post時,hugo會自動在新檔案中的最上面加入
front matter
- EX:
hugo new post/my-first-post.md
以下即為 my-first-post.md 的 front matter
---
title: "新增一篇文章"
date: 2020-03-22T11:13:57+08:00
lastmod: 2020-03-22T11:13:57+08:00
publishdate: 2020-03-22T11:13:57+08:00
description: ""
weight: 4
---
新增一篇文章
- 每種佈景需要的front matter不太一樣
- Hugo會在 archetypes 裡,用下面的順序來找適合的檔案
- archetypes/post.md
- archetypes/default.md
- themes//archetypes/posts.md
- themes//archetypes/default.md
- 所以一般都要把佈景對應的 archetypes 裡的檔案覆蓋到根目錄的 archetypes
新增在content資料夾
文章要放在那個資料夾,要看使用的佈景
hugo new 路徑/檔名.md
新增在content資料夾的post目錄
hugo new post/路徑/檔名.md