ppeetteerrs / obsidian-zola

A no-brainer solution to turning your Obsidian PKM into a Zola site.
http://peteryuen.netlify.app/
MIT License
684 stars 138 forks source link

Want to change cyrillic symbols to lat generating article name #7

Closed assopri closed 2 years ago

assopri commented 2 years ago

Hi! I forked repositary and want to change cyrillic symbols to lat generating article name. Which script is responcible for generating ther article URL? image

assopri commented 2 years ago

the similar feature already works here (when click on particular header): image

ppeetteerrs commented 2 years ago

HI, if you look into run.sh, you will see that obsidian-export is used to parse your Obsidian Markdown files. It handles all the link and URL generation according to the filenames. You can add a script before that step to convert your file names (and all associated links) but it might be easier to just set the filenames in Obsidian in lat and convert them to cyrillic in convert.py.

To convert filename in lat to article title in cyrillic, see write_frontmatters in convert.py, just change the way title is parsed.

As for why it works for heading links, see filter_lines in convert.py, I assume Python's string decoding handled that.

assopri commented 2 years ago

Thank you for the detailed responce!!

assopri commented 2 years ago

HI, if you look into run.sh, you will see that obsidian-export is used to parse your Obsidian Markdown files. It handles all the link and URL generation according to the filenames. You can add a script before that step to convert your file names (and all associated links) but it might be easier to just set the filenames in Obsidian in lat and convert them to cyrillic in convert.py.

To convert filename in lat to article title in cyrillic, see write_frontmatters in convert.py, just change the way title is parsed.

As for why it works for heading links, see filter_lines in convert.py, I assume Python's string decoding handled that.

It`s a nice solution for cyrillic symbols, however I still face another issue = the spaces in filename are not replaced with dashes: https://peteryuen.netlify.app/docs/programming/python**%20**advanced**%20**typings/ . Can I somehow override the default URL generation mechanics of obsidian-export (to change spaces to dashes)?

ppeetteerrs commented 2 years ago

For that you can probably try turning on slugify.paths in config.toml. I think that is on Zola's part. I forgot why I disabled it, maybe it caused some bugs but you can try it haha.

assopri commented 2 years ago

Cool! Slugify paths solved both issue of spaces and cyrillyc to lat characters. If you remind what can go wrong with it - let me know))) image

assopri commented 2 years ago

I found what happens. Even if slugify paths is on, urls in links still use default url generation format: image

any ideas how can I fix that?

ppeetteerrs commented 2 years ago

You can probably just replace spaces with dashes in replaced_links.

Screenshot_20220409-155104_GitHub.png