Flickr Images Plugin for DocPad
This plugin will handle uploading images to flickr and linking them to your site in DocPad
Work in progress
Lots of thing to do:
- Currently the output has been made to work with fancybox, which is fine for me, but not for everyone.
- Explain step by step how to obtain flickr OAuth keys (not so straight forward).
- unit tests are very light and do not test any important stuff
Install
npm install --save docpad-plugin-flickrimages
Usage
The way it works is by looking into src/files/flickr-images/#{document.flickrImagesDirectory or document.basename}
for files. Where flickrImagesDirectory
is set in your document's meta data, and if it doesn't exist it will use the document's basename (e.g. the basename of my-holiday-2012.html.eco
is my-holiday-2012
). Any files inside that path will be associated to your document, and retrievable by @getDocument().getAssociatedFiles()
Lets see how this works, we have the document src/documents/my-holiday-2012.html.eco
:
---title: My Holiday in 2012---Here are some great photos from our trip<%- @getDocument().getFlickrImage('The Eiffel Tour.jpg') %>
Then we will stick The Eiffel Tour.jpg in this folder: src/files/flickr-images/my-holiday-2012
. And we'll end up with the rendered result:
Here are some great photos from our trip
You need to create a .env file in your docpad repository containing the following line:
flickrKey=1xxxxxxxxxxxxxxxxxxxxxxxxflickrSecret=0xxxxxxxxxxxxxflickrOAToken=7xxxxxxxxxxx-3xxxxxxxxxxxxxflickrOASecret=5xxxxxxxxxxxxx
Isn't that cool?
History
You can discover the history inside the History.md
file
License
Licensed under the incredibly permissive MIT License
Copyright © 2013+ Thomas Piart