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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '08d52c799b1be3a7e36cec03f8a9bef0077b3157'
4
- data.tar.gz: c588c8f2a4bd69aa051c84b571bb489bab40d4d2
3
+ metadata.gz: 73ce9c14613691b790731e566a736b8815195a19
4
+ data.tar.gz: d43a4f4fb7111ae46713e6e2642be74bd5d1fe60
5
5
  SHA512:
6
- metadata.gz: 3bfbeec7b14f0ee7c771868a87b51fc1ee7798e1e1020bcdeb68834bfde30824c1939d38668cd8bccd2c55225c4cccb59b69646c6e7cfc3cd2926ad48cc5a72a
7
- data.tar.gz: 8a84fef0dc6a3c82766d01cc935322c76119978018208c7e9617c8dfa1947434ed54469dd2d2d9f177d77a6c8993c051e95d4837ab4433a1f6a730644f9c422e
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: 800
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' => 800,
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 = "&copy; 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>
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Onebox
5
- VERSION = "0.1.0".freeze
5
+ VERSION = "0.1.1".freeze
6
6
  end
7
7
  end
data/lib/jekyll-flickr.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "jekyll-onebox/version"
4
- require "jekyll-onebox/flickr_tag"
3
+ require "jekyll-flickr/version"
4
+ require "jekyll-flickr/flickr_tag"
5
5
 
6
6
  module Jekyll
7
7
  module Flickr
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-flickr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Riemann