跳转到主内容
菜单

用 hugo convert 转换 front matter

约 1 分钟 更新于 2026-10-05

由于之前很多的笔记的 front-matter 都是 TOML 格式的,可很多情况下发文都是很胖大的

hugo-cli-convert-toYAML.md

sh
$ hugo help convert
Convert will modify your content to different formats

Usage:
  hugo convert [command]

Available Commands:
  toJSON                    Convert front matter to JSON
  toTOML                    Convert front matter to TOML
  toYAML                    Convert front matter to YAML
--------------------------------------------------------
$ hugo convert toYAML --output content_as_yaml
processing 54 content files

Convert will modify your content to different formats

Example

shell
hugo convert toTOML --output content_as_toml
# processing 57 content files
ls content_as_toml
# 列出目录后会存在
content_as_toml
|-content