jekyll-flickr 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +3 -1
- data/lib/jekyll-flickr/flickr_tag.rb +5 -6
- data/lib/jekyll-flickr/version.rb +1 -1
- data/lib/jekyll-flickr.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73ce9c14613691b790731e566a736b8815195a19
|
4
|
+
data.tar.gz: d43a4f4fb7111ae46713e6e2642be74bd5d1fe60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d206f05f43e5e0bb88c6525abaf243589c3ef937612a38dada6ec3da6435cfd470524e93d99f1a7ae7d7deefd7d0325f31ae3d041b49f58f8eb185a872fe863
|
7
|
+
data.tar.gz: 226f62d875fcd74bab8f19a11afa5d0e020162481881419be545ce4d37830b0742eabcd0d077616c3e874e0941551268d12689582f590c26529c76139115d28c
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
## HEAD
|
2
2
|
|
3
|
+
## 0.1.1 / 2017-04-09
|
4
|
+
|
5
|
+
* feature: add CSS class `flickr` to HTML
|
6
|
+
* feature: fallback to original image size if fallback `width_legacy` is not offered by Flickr API.
|
7
|
+
|
8
|
+
* fix: remove debugging notice
|
9
|
+
* fix: broken path to ruby lib
|
10
|
+
* fix: add missing require for cache
|
11
|
+
* fix: use 1024 instead of 800 as fallback width `width_legacy`, because 800 seems to be less often available.
|
3
12
|
|
4
13
|
## 0.1.0 / 2017-04-08
|
5
14
|
|
data/README.md
CHANGED
@@ -76,7 +76,7 @@ flickr:
|
|
76
76
|
api_key: <flickr_api_key>
|
77
77
|
api_secret: <flickr_shared_secret>
|
78
78
|
widths: [320, 640, 800, 1024, 1600]
|
79
|
-
width_legacy:
|
79
|
+
width_legacy: 1024
|
80
80
|
width_viewport: 100vw
|
81
81
|
figcaption: true
|
82
82
|
license: true
|
@@ -89,11 +89,13 @@ The configuration option `width_viewport` allows to define the occupying width o
|
|
89
89
|
|
90
90
|
## TODO
|
91
91
|
|
92
|
+
- add option to enable a link from the image to the Flickr photo page or just a larger version of the image
|
92
93
|
- allow more control on cache expiration
|
93
94
|
- allow for custom templates globally configured
|
94
95
|
- allow for templates per tag via some arguments
|
95
96
|
- block version (`Liquid::Block`) that allows to enclosure the caption
|
96
97
|
- use a more sophisticated RegExp to allow for captions with quotation marks
|
98
|
+
- privacy mode: download images to build to not require user requests to Flickr servers
|
97
99
|
|
98
100
|
## Similar Projects
|
99
101
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'flickraw-cached'
|
4
|
+
require 'jekyll-cache'
|
4
5
|
|
5
6
|
module Jekyll
|
6
7
|
module Flickr
|
@@ -9,7 +10,7 @@ module Jekyll
|
|
9
10
|
# selection of sizes from those offered by Flickr API
|
10
11
|
DEFAULT_CONFIG = {
|
11
12
|
'widths' => [320, 640, 800, 1024, 1600],
|
12
|
-
'width_legacy' =>
|
13
|
+
'width_legacy' => 1024,
|
13
14
|
'figcaption' => true,
|
14
15
|
'license' => true,
|
15
16
|
'caption' => true,
|
@@ -91,7 +92,7 @@ module Jekyll
|
|
91
92
|
|
92
93
|
widths = config['widths'] + [config['width_legacy']]
|
93
94
|
photo_sizes = photo_data[:sizes].select{ |photo| widths.include?(photo['width'].to_i) }
|
94
|
-
photo_legacy = photo_data[:sizes].find{ |photo| photo['width'].to_i == config['width_legacy']}
|
95
|
+
photo_legacy = photo_data[:sizes].find{ |photo| photo['width'].to_i == config['width_legacy']} || photo_data[:sizes].find{ |photo| photo['label'] == 'Original'}
|
95
96
|
|
96
97
|
srcset = photo_sizes.map{|photo| "#{photo['source']} #{photo['width']}w"}.join(", ")
|
97
98
|
|
@@ -105,7 +106,7 @@ module Jekyll
|
|
105
106
|
photo_attr += " alt=\"#{photo_caption}\""
|
106
107
|
end
|
107
108
|
|
108
|
-
img_tag = "<img src=\"#{photo_legacy.source}\" srcset=\"#{srcset}\" sizes=\"#{sizes}\" #{photo_attr}>"
|
109
|
+
img_tag = "<img class=\"flickr\" src=\"#{photo_legacy.source}\" srcset=\"#{srcset}\" sizes=\"#{sizes}\" #{photo_attr}>"
|
109
110
|
|
110
111
|
return img_tag if not config['figcaption']
|
111
112
|
|
@@ -114,8 +115,6 @@ module Jekyll
|
|
114
115
|
|
115
116
|
owner_link = "© Flickr/<a href=\"#{photo_data[:info]['urls'].first['_content']}\">#{photo_data[:info]['owner']['username']}</a>"
|
116
117
|
|
117
|
-
puts license.inspect
|
118
|
-
|
119
118
|
license_link = if license[:url]
|
120
119
|
"<a href=\"#{license[:url]}\">#{license[:name]}</a>"
|
121
120
|
else
|
@@ -135,7 +134,7 @@ module Jekyll
|
|
135
134
|
return img_tag if photo_license.empty? and photo_caption.empty?
|
136
135
|
|
137
136
|
return <<-HTML
|
138
|
-
<figure>
|
137
|
+
<figure class="flickr">
|
139
138
|
#{img_tag}
|
140
139
|
<figcaption>#{photo_caption}#{photo_license}</figcaption>
|
141
140
|
</figure>
|
data/lib/jekyll-flickr.rb
CHANGED