修改hugo新建post的默认信息(front matter)

Front matter allows you to keep metadata attached to an instance of a content type—i.e., embedded inside a content file—and is one of the many features that gives Hugo its strength.

当你使用hugo new posts/your_post.md新建文章的markdown文件时,该文件已默认创建了包括标题、创建时间等信息。 这些元数据被称为Front Matter ,如果你需要了解 Hugo 预定义的 Front Matter 或更多关于 Front Matter 的内容,可以参考 主题会提供默认的格式及内容,这些信息保存在themes/yourtheme/archetypes/posts.md,例如Fixit主题提供模板文件:

title: "{{ replace .TranslationBaseName "-" " " | title }}"
subtitle: ""
date: {{ .Date }}
draft: true
author: ""
authorLink: ""
authorEmail: ""
description: ""
keywords: ""
license: ""
comment: false
weight: 0

tags:
- draft
categories:
- draft

hiddenFromHomePage: false
hiddenFromSearch: false

summary: ""
resources:
- name: featured-image
src: featured-image.jpg
- name: featured-image-preview
src: featured-image-preview.jpg

toc:
enable: true
math:
enable: false
lightgallery: false
seo:
images: []

repost:
enable: true
url: ""

# See details front matter: /theme-documentation-content/#front-matter
---

<!--more-->

可以将第六行author: ""修改为author: "your name",这样每次新建文章,你将无需手动添加作者信息。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值