After my last post, I wanted to write something about IDN and browser support.
So I made lot's of screen shots about how well IDN is supported.
Then I figured that if I ever wanted to do more than one post with images on this blog, I had to host those images somewhere...
So, I started looking at some image hosting services, like google, 500px, ... and in the end, I choose flickr because they have an API, and I already had an account.
In order to avoid uploading images one by one and linking them to my post, I have tried to automate this process using a docpad plugin:
This plugin is a fork from docpad-flickr-associatedfiles. It's a start :).
Here is how it works:
- List all images in a dedicated folder
- Call Flickr to get the list of images with a tag ("docpad" by default, but can be configured)
- Get additional properties (url of images in various sizes,...)
- If local image is not on flickr, upload it
- If local image is on flickr, check the last update, and update the image if necessary
- Remove local image from filethat needs to be copied to the output directory
- In any page, add a link to an image using document.getFlickrImage('my image.png')
- this call will be replace by a reference to the image on flickr
- Update an image
- There are no tests
- Error cases are not working
A little example:[EDIT: Fev 2017: does not work yet in Hugo]
%- @getDocument().getFlickrImage('blog post code.png') %
%- @getDocument().getFlickrImage('beaglebone.jpg') %
Also: by default, getFlickrImage return a piece of HTML that works fine with fancybox.