The One With CDN For Blog Pictures
So, it's been almost a year since I made my first (and still only) post here. Obviously, I'm not much of a writer, or perhaps I just don't have too many bright things to say. And since I'm now using YouTube to spread the joy of recreational programming, that's probably not going to change anytime soon. So, I'll just try to use this blog as a more generic personal feed and see where it goes. And what does any feed need nowadays? Pictures!
Pictures? Don't you need to leave the house to make those?
Yeah, that's true. But sometimes I do, and now I'll have the proof!
I'm still running an iPhone SE since there don't seem to be any more usable small-factor smartphones on the market - so I got a compact fixed-lens Sony RX100 VII to shoot with. I have no clue about photography, so expect JPEGs in mostly auto mode.
Cee Dee What?
CDN, Content Delivery Network. This GitHub Pages-hosted blog is sitting behind a Cloudflare proxy, so technically, I could have configured CDN caching for assets without implementing any changes in b3. However, I wasn't too excited about storing megabytes of pictures in Git - so we are going to upload them to R2 bucket with public access via a custom domain.
Here is the implementation diff. Essentially, we can now run b3 --mode=cdn
, and it will: find all image references in markdown (blog post) files; pick those that match assets_to_upload_regexp according to b3.json configuration; upload matched images to S3-compatible bucket; and replace image paths of affected images in markdown source files with their respective public links. Simple!
Just show some pictures already
Fair enough. These are from a quick trip last week in the northeastern Netherlands:
Zwolle
Vecht River
Niet zwemmen!!
Elburg
Elburg
52.63657467882655, 5.41540789445472
🫡