`hugo new post.md` 创建新 post 时如何添加 "tags" 和 "categories"

How to add "tags" and "categories" when creating new post by `hugo new post.md`

创建一个新的 post 我 运行 喜欢:

hugo new posts/post.md

然后生成的文件是这样的:

---
title: "Post"
date: 2019-10-27T15:57:27+09:00
draft: true
---

一般我都是用tagscategories,如果能默认加上就更好了

---
title: "Post"
date: 2019-10-27T15:57:27+09:00
draft: true
categories:
tags:
---

在哪里以及如何配置 hugo new 命令来完成此行为?

您想编辑 posts/*.md 个文件的原型文件。有关此的信息位于:

  1. https://gohugo.io/content-management/archetypes/

  2. https://www.ii.com/themeless-gitless-intro-hugo/#_edit_the_archetype_for_new_md_content_files

在#2[*]中说:使用文本编辑器打开archetypes/default.md,它看起来像这样:

---
## Important: If this is a draft, next line should NOT begin with #
# draft: true
title: {{ replace .Name "-" " " | title }}
date: {{ now.Format "2006-01-02" }}
## below are user-defined parameters (lower case keys recommended)
subtitle:
tags:
  - tag1
  - tag2
---

您可以将各种事物放入原型中,包括正文内容。

希望对您有所帮助,
N(Whosebug 发帖新手)

[*] 我写了#2。希望在这里自我link没问题