jekyll-amazon 0.2.0 → 0.2.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: da83b3be2c74bd71cdba9a72ab120695ba7f11b1
4
- data.tar.gz: da0ba626962a763761bd7c7644339a856a30604f
3
+ metadata.gz: 6231b5acafab23def30852d2afd8c66f8f38c80f
4
+ data.tar.gz: 00a275662d32a15da94aeebe90b13d36dd82b47e
5
5
  SHA512:
6
- metadata.gz: fd197cf4998c8a36d9872016e1e666ac53fdc02e2dd987d4c7e26457b491d50c2a0312cf45cc69907f4a41374c86336d09c6563619be2586539318d3dacaba4f
7
- data.tar.gz: 1c77ad77a27cc3eb6436ebbe97e8c4e596338f3f0971ce885caa3df5bd5a21c6c79f83107d2aad05cd24ba7396bd5cabb58d3b52c7213b18c74f5e07536a02e9
6
+ metadata.gz: ef5de7c7ff99bf8f7ec827a038ad79e3bbc7d27cbb4feec34e0972d04ef613d195673252a766a6ad7ad301fdbc935cc8f32688f5d68dcb3dc7e83c2ab0e2b80b
7
+ data.tar.gz: 0a39eea82d48d29434ca31a6f76a6a1d50860ad8466da8a1c8f1a2a338af944f222a47a82d84d54315821c5649eb34bc31040714237744cbc633ba60b9024e4f
data/README.md CHANGED
@@ -22,7 +22,7 @@ And set the environment varables of the amazon ecs:
22
22
 
23
23
  $ export ECS_ASSOCIATE_TAG=...
24
24
  $ export AWS_ACCESS_KEY_ID=...
25
- $ export AWS_SECRET_KEY...
25
+ $ export AWS_SECRET_KEY=...
26
26
 
27
27
 
28
28
  Finally, add the following to your site's `_config.yml`:
data/_sass/jk_amazon.scss CHANGED
@@ -1,16 +1,20 @@
1
+ .jk-amazon-image {
2
+ min-height: 1px;
3
+ width: 130px;
4
+ }
5
+
6
+ .jk-amazon-info-title {
7
+ padding-bottom: 10px;
8
+ }
9
+
1
10
  .jk-amazon-item {
2
11
  margin-bottom: 20px;
3
12
  .jk-amazon-image {
4
13
  float: left;
5
- min-height: 1px;
6
- width: 130px;
7
14
  }
8
15
  .jk-amazon-info {
9
16
  margin-left: 130px;
10
17
  min-height: 1px;
11
- .jk-amazon-info-title {
12
- padding-bottom: 10px;
13
- }
14
18
  }
15
19
  &:before, &:after {
16
20
  display: table;
@@ -136,9 +136,7 @@ module Jekyll
136
136
  def initialize(tag_name, markup, tokens)
137
137
  super
138
138
  parse_options(markup)
139
- if asin.nil? || asin.empty?
140
- raise SyntaxError, "No ASIN given in #{tag_name} tag"
141
- end
139
+ error "No ASIN given in #{tag_name} tag" if asin.nil? || asin.empty?
142
140
  end
143
141
 
144
142
  def render(context)
@@ -160,7 +158,10 @@ module Jekyll
160
158
  def title(item)
161
159
  url = item[:detail_page_url]
162
160
  title = item[:title]
163
- format(%(<a href="%s" target="_blank">%s</a>), url, title)
161
+ format(
162
+ %(<a class="jk-amazon-info-title" href="%s" target="_blank">%s</a>),
163
+ url, title
164
+ )
164
165
  end
165
166
 
166
167
  def image(item)
@@ -168,7 +169,7 @@ module Jekyll
168
169
  title = item[:title]
169
170
  image_url = item[:medium_image_url]
170
171
  str = <<-"EOS"
171
- <a href="#{url}" target="_blank">
172
+ <a class="jk-amazon-image" href="#{url}" target="_blank">
172
173
  <img src="#{image_url}" alt="#{title}" />
173
174
  </a>
174
175
  EOS
@@ -186,13 +187,9 @@ module Jekyll
186
187
 
187
188
  str = <<-"EOS"
188
189
  <div class="jk-amazon-item">
189
- <div class="jk-amazon-image">
190
- #{image(item)}
191
- </div>
190
+ #{image(item)}
192
191
  <div class="jk-amazon-info">
193
- <div class="jk-amazon-info-title">
194
- #{title(item)}
195
- </div>
192
+ #{title(item)}
196
193
  #{attrs}
197
194
  </div>
198
195
  </div>
@@ -203,6 +200,10 @@ module Jekyll
203
200
  def br2nl(text)
204
201
  text.gsub(%r{&lt;br\s*/?&gt;}, "\n") unless text.nil?
205
202
  end
203
+
204
+ def error(message)
205
+ raise SyntaxError, message
206
+ end
206
207
  end
207
208
  end
208
209
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Amazon
3
- VERSION = '0.2.0'.freeze
3
+ VERSION = '0.2.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-amazon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - tokzk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-27 00:00:00.000000000 Z
11
+ date: 2016-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amazon-ecs