Python script managing all the locally source Astro sites' collections working well
Posted on 19th Jun 2026 at 09:53 by Admin
App notes
Read and edit frontmatter from Astro pages and posts collections
With current small number of files completely reload database with collection on each app_refresh(). It doesn’t take long.
Continue to load file modification epoch, so optimisation could be introduced in future.
Actually, It’s really handy to see the modification time in the datasheet.
Use DB, mainly for datasheet support in tksupp.py, but data persistence is handy.
SQLite to avoid cluttering MySQL. Watch out for placeholder oddity.
Persistent SQLite file no extra effort over in-memory tables, and mildly convenient for debugging.
DS up/down key binding more awkward than Perl/Tk. See ‘Files up/down key binding’.
Not really a problem here because no tab has more than one datasheet.
Standard Python yaml loses # comments (in the conversion to the dict).
I only use them for the file name, which is obvious in the text editor and in the browser.
python3-ruamel.yaml can be installed, but the Gemini supplied fmatter_fix_yaml() function fails.
Abandon comments in frontmatter.
Report
This report is generated by % npm run meta-report.
It’s interesting as an example of a Node.js script, but it only reports on one site.
A Python script could do the same thing for all the sites. Where should the report go?
To Do
- Capitalise categories and tags
- Bulk processes
Category: news Tags: dev frontmatter