diff options
Diffstat (limited to 'hugo-convert-yaml-frontmatter-to-toml/README.md')
| -rw-r--r-- | hugo-convert-yaml-frontmatter-to-toml/README.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hugo-convert-yaml-frontmatter-to-toml/README.md b/hugo-convert-yaml-frontmatter-to-toml/README.md new file mode 100644 index 0000000..d2655df --- /dev/null +++ b/hugo-convert-yaml-frontmatter-to-toml/README.md @@ -0,0 +1,12 @@ +这个 Python 脚本使用 Kimi K2.5 Instant 生成,提示词如下: + +``` +我需要你帮我写个 Python 脚本,把我 Hugo 网站的 `content` 目录下所有的 markdown 文件的 frontmatter 改为 TOML 格式。其中有一些是 TOML,有一些是 YAML。以 `---` 开头文件就是 YAML 做 frontmatter 的,只处理这些文件;TOML frontmatter 是 `+++` 开头的 +``` + +## 使用方法 + +1. 安装依赖 `pip install pyyaml tomli-w` +2. 先预览改动 `python script.py --dry-run` 或者 `uv run script.py --dry-run` +3. 确认后应用修改 `python script.py` 或者 `uv run script.py` + |
