Originally published at Marius Toolbox
A few days ago I announced on BlueSky that I created a small tool to convert my leaflet posts (like the one you are reading right now) to markdown, so that they can also show up on my hugo based blog.
I promised to follow up with an article about how I use it and that’s what you are reading now.
In the root directory of your hugo blog you’ll need to create a file .leaflet-sync.yaml - here is what mine looks like.
| |
In this same directory you now need to run leaflet-hugo-sync - my recommendation for now would be to just use
| |
But I might also look into producing an official release soon.
This will create a folder content/posts/leaflet containing all your leaflet posts with sanitized version of the post name as the file name.
If you leave out the publication_name it will get all your leaflets which may or may not what you want.
You can then use the template section to customize the content a bit, I for example added links back to the leaflet at the top and bottom of the posts.
If you actually use this I would love to hear feedback <3 I will also soon publish another post to detail the entire setup of how I now host my hugo blog on mariuskimmina.com and keep it sync with my leaflet posts.
Source:
https://tangled.org/mariuskimmina.com/leaflet-hugo-sync
https://github.com/mariuskimmina/leaflet-hugo-sync
You can find my blog, including this posts, on https://mariuskimmina.com/posts/
Originally published at Marius Toolbox