jekyll-galleries 0.8.1 → 0.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 97094652304097fd23bedda6bd418b77c8aa6c36
4
- data.tar.gz: 5e750d11dfc95fbef20ad81222bc5f62ea46948e
3
+ metadata.gz: 84788dbeff9a910861fe8b47da62ac7336a96d63
4
+ data.tar.gz: 3a82b81e91cae139c54596b3663816bf90a70b61
5
5
  SHA512:
6
- metadata.gz: 0298c72a757f8b41a5cacb7fa15d0b3d83b178a948743146828d4ad8eafe2a46504861ea881714fb1c6c80059d17d7f5b5568931b28ebdb29d97e19d8d965ab7
7
- data.tar.gz: c063ffd4cb8d39d9a77133d90ce44425d47ee9b164852db4457a0c74f74b46f436f7e4ff5c66a74fb144b5abd1f7bc061ac06fffa65dd11cc8eaccdcb94f3ea1
6
+ metadata.gz: e20a284f988c8e62f1a5f252f9b36c60b0c25c5f0f728059f40e7365dbd86cb1328a746ee16618df63c3e609e0c7c0f5ecb9f931911bdd9df8232a7474157a2e
7
+ data.tar.gz: 3e748752c4d65a449f1fb0865972446fdb0a811dfe4a8e4cfac306edc773de01c916c9dd40d62dcb57be5af76e0ddd4785b9fac0680ea469e49f415820ca5062
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.8.2 [2014-05-07]
2
+
3
+ * Add gallery cover thumbnail
4
+
1
5
  == 0.8.1 [2014-05-07]
2
6
 
3
7
  * Fixed bug: thumbnail generation not working
data/README.md CHANGED
@@ -66,6 +66,8 @@ Inside the optional `galleries` attribute in `_config.yml`, you can have objects
66
66
 
67
67
  Then in the template, the gallery will have the attribute `subtitle` that can be rendered.
68
68
 
69
+ ###### `top` attribute
70
+
69
71
  Another attribute is `top`. If you set `top: true` for a gallery, then this gallery will always be put on top of the galleries index page. For example:
70
72
 
71
73
  galleries:
@@ -73,6 +75,10 @@ Another attribute is `top`. If you set `top: true` for a gallery, then this gall
73
75
  subtitle: This is a sample gallery
74
76
  top: true
75
77
 
78
+ ###### `thumbnail` attribute
79
+
80
+ `thumbnail` is a special optional attribute. If you want to add a gallery cover thumbnail to galleries index page, you need to specify the thumbnail file name (not path).
81
+
76
82
  ##### 5. Use attributes in template
77
83
 
78
84
  Now, the `site.data['galleries']` global variable contains all the gallery pages. It is an array of `GalleryPage` objects. Each `GalleryPage` object has at least three attributes: `name`, `date` and `url`. `url` is URL escaped. You can use them in your galleries index page.
@@ -70,7 +70,7 @@ module Jekyll
70
70
  self.gallery_dir = gallery_dir
71
71
  self.content = data.delete('content') || ''
72
72
  self.data = data
73
- self.thumbs_dir = site.config['thumbs_dir']
73
+ self.thumbs_dir = site.config['thumbnails_dir']
74
74
 
75
75
  self.gallery_dir_name = File.basename gallery_dir
76
76
  super(site, base, gen_dir, self.gallery_dir_name)
@@ -81,7 +81,7 @@ module Jekyll
81
81
  end
82
82
 
83
83
  def generate_photos
84
- photos_config_filepath = "#{@base}/#{@site.config['gallery_dir']}/#{self.date}-#{self.name}.yml"
84
+ photos_config_filepath = "#{@base}/#{@site.config['gallery_dir']}/#{self.date}-#{self.name}.yml"
85
85
  photos_config = YAML.load(File.open(photos_config_filepath).read) if File.exists?(photos_config_filepath) # config of this gallery
86
86
 
87
87
  # generating photos
@@ -111,6 +111,11 @@ module Jekyll
111
111
  attr.each { |k, v| self.data[k] = v }
112
112
  end
113
113
  end
114
+
115
+ # generating gallery cover thumbnail
116
+ if self.data['thumbnail']
117
+ self.data['thumbnail'] = URI.escape("/#{self.gen_dir}/#{self.gallery_dir_name}/#{self.data['thumbnail']}")
118
+ end
114
119
  end
115
120
 
116
121
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-galleries
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - allenlsy