If you maintain a Hugo multilingual blog, you probably run into a frequent pain point:
- After finishing Chinese content, you still need synchronized English and Traditional Chinese versions
- All language files must keep the same structure
- Front matter must be translated while still following Hugo format rules
sync-post-translations is built for exactly this scenario.
What Problem This Skill Solves
The positioning of sync-post-translations is straightforward:
- Use
index.zh-cn.mdas the source file - Generate or update
index.en.mdandindex.zh-tw.mdin the same directory - Keep Markdown structure consistent
- Apply explicit front matter rules (especially
dateandslug)
Example trigger phrases:
- “Sync translation to English and Traditional Chinese”
- “Translate this post to English and Traditional Chinese”
Skill Directory Structure
|
|
Core Code 1: SKILL.md
Below is the core rules file of this skill:
|
|
Core Code 2: agents/openai.yaml
This file defines how the skill is presented and prompted on the agent side:
|
|
Practical Usage Example
1) Natural language trigger
|
|
2) Expected output
|
|
Why These Rules Matter
- Keeping
slugunchanged preserves stable URLs and historical backlinks. - Normalizing
dateto RFC3339 with timezone avoids Hugo/theme parsing ambiguity. - Keeping Markdown structure unchanged prevents TOC, code block, and shortcode rendering issues.
- Not translating technical identifiers significantly reduces broken command/file mismatches.
Common Pitfalls and How to Avoid Them
- If
titlecontains:without quotes, YAML parsing can fail. - Translating
--flags, URLs, or package names will break command examples. - If heading levels differ across languages (for example,
##becoming###), anchors can become inconsistent. - Translating only body content but not front matter can break list pages and SEO metadata.