jekyll-flickr 0.1.1 → 0.1.2
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 +5 -5
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/lib/jekyll-flickr/flickr_tag.rb +18 -5
- data/lib/jekyll-flickr/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 36695c3c9dde937ec527bf19b34865327ec83248d5acab73ba1e88b84f6f79a9
|
4
|
+
data.tar.gz: 7092b44fc42b05d27716c2805f5fb5aa73be2d0fe264ff34d036d49a6dc4d996
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7423f1d84db3884f2e2c2b9dcb5c266db713a33e71788ae478993bb141136f4961b4e310cc110d272f14a7c744522f00331b9fb09c875ef5e68441ed6bcc58dc
|
7
|
+
data.tar.gz: 0a71a46c59c36f8f8708096360acc253cf9533adce08785f75371f8e5e3d57e768bcd8e43558658923217692cca91cec4acca70de3baa8544de92349846fbc09
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -51,7 +51,7 @@ Use the tag as follows in your Jekyll pages, posts and collections:
|
|
51
51
|
Example:
|
52
52
|
|
53
53
|
```liquid
|
54
|
-
{% flickr 38285149681 "My favourite photo of the month." style="float: right;"}
|
54
|
+
{% flickr 38285149681 "My favourite photo of the month." style="float: right;" %}
|
55
55
|
```
|
56
56
|
|
57
57
|
This will create the following HTML output:
|
@@ -71,8 +71,24 @@ module Jekyll
|
|
71
71
|
@text = text.strip
|
72
72
|
end
|
73
73
|
|
74
|
+
def flickr
|
75
|
+
@@flickr ||= begin
|
76
|
+
FlickRaw.api_key = ENV['FLICKR_API_KEY'] || config['api_key']
|
77
|
+
FlickRaw.shared_secret = ENV['FLICKR_API_SECRET'] || config['api_secret']
|
78
|
+
|
79
|
+
@@flickr = FlickRaw::Flickr.new
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def cache
|
84
|
+
@@cache ||= Jekyll::Cache::FileStore.new 'flickr'
|
85
|
+
end
|
86
|
+
|
87
|
+
def config
|
88
|
+
@@config ||= DEFAULT_CONFIG.merge(Jekyll.configuration({})['flickr'])
|
89
|
+
end
|
90
|
+
|
74
91
|
def render(context)
|
75
|
-
config = DEFAULT_CONFIG.merge(context.registers[:site].config['flickr'])
|
76
92
|
|
77
93
|
match = /(?<photo_id>\d+)(\s(\"(?<caption>[^"]+)\"))?(?<attr>.*)/.match @text
|
78
94
|
|
@@ -80,10 +96,7 @@ module Jekyll
|
|
80
96
|
photo_caption = match.named_captures['caption']
|
81
97
|
photo_attr = match.named_captures['attr']
|
82
98
|
|
83
|
-
|
84
|
-
photo_data = cache.fetch photo_id do
|
85
|
-
FlickRaw.api_key = ENV['FLICKR_API_KEY'] || config['api_key']
|
86
|
-
FlickRaw.shared_secret = ENV['FLICKR_API_SECRET'] || config['api_secret']
|
99
|
+
photo_data = cache.fetch photo_id, expires_in: -1 do # disable expiry in production and development environment
|
87
100
|
{
|
88
101
|
info: flickr.photos.getInfo(photo_id: photo_id),
|
89
102
|
sizes: flickr.photos.getSizes(photo_id: photo_id)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-flickr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Riemann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll-cache
|
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
version: '0'
|
132
132
|
requirements: []
|
133
133
|
rubyforge_project:
|
134
|
-
rubygems_version: 2.
|
134
|
+
rubygems_version: 2.7.9
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: Liquid tag for responsive Flickr images using HTML5 srcset.
|