https://github.com/othree/flickr-share-template
Template based Flickr share photo function
https://github.com/othree/flickr-share-template
Last synced: over 1 year ago
JSON representation
Template based Flickr share photo function
- Host: GitHub
- URL: https://github.com/othree/flickr-share-template
- Owner: othree
- License: other
- Created: 2012-11-28T15:47:38.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2018-10-01T23:23:52.000Z (over 7 years ago)
- Last Synced: 2025-01-24T13:44:47.155Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://chrome.google.com/webstore/detail/flickr-share-with-templat/dfnfhbapijahpaobcpojofokllocfpnc
- Size: 84 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Flickr Share with Template
==========================
Provide template based Flickr share photo function.
Introduction
------------
Flickr's share with HTML/BBCode function is not update for a long time. Several issues bothers me:
* Template didn't support XHTML markup
* Only several size available
* Only **http** protocol is provided, but Flickr do support **https**
* HTML and BBCode is not enough now
* And there is no custom template feature
So I build this chrome extension. Use easy to learn [mustache][] template language.
[mustache]:http://mustache.github.io/
Available Variables
-------------------
The following variables are available in your template.
Basic information:
* title
* desc
* owner.username
* url
Photo in different sizes:
* Square
* Square75
* LargeSquare
* Square150
* Thumbnail
* Small
* Small240
* Small320
* Medium
* Medium500
* Medium640
* Medium800
* Large
* Large1024
* Large1600
* Large2048
* Original
All above sizes have 5 attributes can use:
* url
* source
* sourceNoProtocol
* width
* heigh
**sourceNoProtocol** is a url link without protocol prefix(relative protocol):
//farm8.staticflickr.com/7316/9207170905_47cdf4e1f5_b.jpg
This url format can be use under both **http** and **https** protocol.
An example to use **Large2048** image:

All labels above except **Original** can add a prefix `to`, which implies the largest image can get until reach the label's size. For example, if an image's original width is 1000px. Then use `toLarge2048` will give you `Medium800`. This feature is designed for default image.
Not all size are available if your image is small. So you can detect is it exists:
{{#Large2048}}
{{/Large2048}}
You can write other document not just html. For example, markdown:

Default template is using [srcset][], the listed code below is with beautiful indent for you to see what's inside easily:
[srcset]:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-srcset
KNOWN ISSUE
-----------
Mustache is very logic-less, so its hard to have if-else in your template.