Thoughts
This was originally a test of Zach-Johnson/bhugo: A tool to transform Bear notes into Hugo-compatible markdown files. It looks promising, as I don’t really want to write (much or any?) markdown by hand and if this lets me not do that, great. If not, I’ll nuke it from orbit.
Here’s test embedded image: Another at default size:
Missing features
It is mildly unfortunate that the tool does not handle tags in other places of the text. However, I guess I can deal with that - there’ll be some (garbage) tags at end of the posts, unless I clean them up. I guess the random things in the end do not really matter, though, so this is ‘fine’.
Perhaps I should also change the code so that it will be possible to run it only once, as opposed to watching the directory. With that, I can do it as part of my publishing pipeline.
And finally it seems the images are not automatically handled, and I would definitely want that. Time to hack, I guess. Open source code is always nice as it can be forked.
Result of evaluation
I chose to fork the repo to add features I want - changes:
- do not require any configuration by default
- autodetect Bear location
- default target current repository
- -once flag to run the conversion only once
- preserve the original creation times
- automatically dump the images too (with names that are unique for the posts and therefore ‘work’ going forward too)
- hashtags at chosen place in the file
So here’s the fork: fingon/bhugo: A tool to transform Bear notes into Hugo-compatible markdown files
I looked for other solutions but they didn’t seem to do what I wanted, and this felt like the easiest way (cough) - one day of not working, but instead having fun(?) playing with code.