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 got inspired by this and wrote a little tool that fetches my leaflets and coverts them to markdown so that I can have my leaflets also on my hugo based blog. Needs more testing, use at your own risk. I'll share an article about this later github.com/mariuskimmin... tangled.org/mariuskimmin...
I can now credibly call my personal blog an Atmospheric website, because my leaflets now show up there Here's an overview of how I did it www.pfrazee.com/leaflets/3mb...
My leaflets now show on my personal blog
Publish On PDS, Syndicate To Any Reader
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.
source:
handle: "mariuskimmina.com"
collection: "pub.leaflet.document"
publication_name: "Marius Toolbox"
output:
posts_dir: "content/posts/leaflet"
images_dir: "static/images/leaflet"
image_path_prefix: "/images/leaflet"
template:
frontmatter: |
---
title: "{{ .Title }}"
date: {{ .CreatedAt }}
original_url: "https://toolbox.leaflet.pub/{{ .Slug }}"
author: "{{ .Handle }}"
---
content: |
*Originally published at [Marius Toolbox](https://toolbox.leaflet.pub/{{ .Slug }})*
{{ .Content }}
---
*Originally published at [Marius Toolbox](https://toolbox.leaflet.pub/{{ .Slug }})*In this same directory you now need to run leaflet-hugo-sync - my recommendation for now would be to just use
nix run github:mariuskimmina/leaflet-hugo-syncBut 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/