This commit is contained in:
2026-07-09 10:17:57 +02:00
parent d9927618f5
commit dfa7ef98ef
15 changed files with 411 additions and 36 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
"""
Generate `blog/manifest.json` from the text files present in the blog/ folder.
Run this in the project root to refresh the manifest after adding/removing blog entries.
"""
import os
import json
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
BLOGDIR = os.path.join(BASEDIR, 'blog')
def main():
exts = ('.txt', '.text')
files = [f for f in sorted(os.listdir(BLOGDIR)) if f.lower().endswith(exts)]
out = os.path.join(BLOGDIR, 'manifest.json')
with open(out, 'w', encoding='utf-8') as fh:
json.dump(files, fh, indent=2)
print(f'Wrote {len(files)} entries to {out}')
if __name__ == '__main__':
main()