Help to automatize YAML on notes

Things I have tried

Decided to try this: GitHub - Jekyll-Garden/jekyll-garden.github.io: A Digital Garden Theme for Jekyll. Jekyll Garden lets you create a static HTML version of your markdown notes and publish via Github pages. Made for Obsidian users!

What I’m trying to do

I have a bunch of notes that I want to pass to a blog designed especially for working with notes and wikilinks - but I would first need to do some YAML frontmatter code treatment of my own. I tried to do it manually, but it is too much work. Does anyone know how I can do this automatically?

Would you like to give a use case sample?

sure.

to read a note my website ask the follow YAML

title :
feed: show (or hide if I dont want to show on website)
date : DD-MM-YYYY

I have a lot of notes to put this YAML before submit to the website - linked above, its a jekyll static site hosted by github.
What I’m looking for its a way to do once for all.

Using Python you may try:

import os
for i in os.walk('your_folder'):
    with open(i, "r+") as f:
        lines = f.readlines()
        f.seek(0)
        f.write("---\ntitle : \nfeed: show (or hide if I dont want to show on website)\ndate : DD-MM-YYYY\n---\n")
        f.writelines(lines)  

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.