Visibility internal Owner _ Approver _ Created _ Updated _
add_frontmatter.py
| Field | Value |
|---|---|
| Type | Python |
| Source | Forge/Archived/Sidebar_Reorg/Scripts/add_frontmatter.py |
| Parent | Forge |
| GitHub | Forge/Archived/Sidebar_Reorg/Scripts/add_frontmatter.py |
This page is auto-generated. Edit the source to change the content.
#!/usr/bin/env python3
"""
add_frontmatter.py
Prepends YAML frontmatter to .md files that are missing it.
"""
import os
REPO = '/workspace/erik/uvilo-os'
# NOTE: This script references paths from the pre-split Architecture/ structure.
# After the three-way split (Architecture/ → Product/ + Forge/ + Uvilo/),
# most of these paths no longer exist. This script is retained for historical
# reference only and should not be run as-is.
#
# Updated paths for the current structure:
# Architecture/Domain_Quiz/ → Product/Projects/Domain_Quiz/
# Architecture/Life_Domains/ → Product/Projects/Life_Domains/
# Architecture/Taxonomy/ → Product/Projects/Taxonomy/
# Architecture/Uvilo_Method/ → Product/Projects/Uvilo_Method/
# Architecture/Uvilo_OS/ → Forge/Projects/Uvilo_OS/
FILES = {
'Product/Projects/Domain_Quiz/Lessons.md':
'Domain Quiz — Lessons',
'Product/Projects/Domain_Quiz/Skills/Life_Domain_Quiz/SKILL.md':
'Skill: Life Domain Quiz',
'Product/Projects/Life_Domains/Lessons.md':
'Life Domains — Lessons',
'Product/Projects/Life_Domains/Skills/Life_Domains/SKILL.md':
'Skill: Life Domains',
'Product/Projects/Taxonomy/SKILL.md':
'Skill: Taxonomy',
'Product/Projects/Uvilo_Method/Archive/The_Uvilo_Method_2025-10-01/The_Uvilo_Method.md':
'The Uvilo Method (Oct 2025)',
'Product/Projects/Uvilo_Method/Archive/The_Uvilo_Method_2026-02-07/ARCHIVE/The_Uvilo_Method.md':
'The Uvilo Method (Feb 2026 Archive)',
'Product/Projects/Uvilo_Method/Archive/The_Uvilo_Method_2026-02-07/The_Uvilo_Method_2026-02-12/The_Uvilo_Method_2026-02-12.md':
'The Uvilo Method (Feb 12 2026)',
'Product/Projects/Uvilo_Method/Archive/book_database_appendices.md':
'Appendices — Uvilo Self-Help Book Database',
'Product/Projects/Uvilo_Method/Archive/book_database_whitepaper.md':
'The Uvilo Self-Help Book Database',
'Product/Projects/Uvilo_Method/Archive/taxonomy_system.md':
'The Uvilo Taxonomy System',
'Product/Projects/Uvilo_Method/Output/The_Uvilo_Method.md':
'The Uvilo Method',
'Product/Projects/Uvilo_Method/Skills/Uvilo_Method_Release/SKILL.md':
'Skill: Uvilo Method Release',
'Forge/Projects/Uvilo_OS/SKILL.md':
'Skill: Uvilo OS',
}
def add_frontmatter(rel_path, title):
abs_path = os.path.join(REPO, rel_path)
with open(abs_path, 'r', encoding='utf-8') as f:
content = f.read()
if content.startswith('---'):
print(f' SKIP (already has frontmatter): {rel_path}')
return
frontmatter = f'---\ntitle: "{title}"\nvisibility: internal\n---\n\n'
with open(abs_path, 'w', encoding='utf-8') as f:
f.write(frontmatter + content)
print(f' OK: {rel_path}')
for rel_path, title in FILES.items():
add_frontmatter(rel_path, title)
print('\nDone.')