jekyll-galleries 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/README.md +6 -0
- data/lib/jekyll/galleries.rb +7 -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: 84788dbeff9a910861fe8b47da62ac7336a96d63
|
4
|
+
data.tar.gz: 3a82b81e91cae139c54596b3663816bf90a70b61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e20a284f988c8e62f1a5f252f9b36c60b0c25c5f0f728059f40e7365dbd86cb1328a746ee16618df63c3e609e0c7c0f5ecb9f931911bdd9df8232a7474157a2e
|
7
|
+
data.tar.gz: 3e748752c4d65a449f1fb0865972446fdb0a811dfe4a8e4cfac306edc773de01c916c9dd40d62dcb57be5af76e0ddd4785b9fac0680ea469e49f415820ca5062
|
data/ChangeLog
CHANGED
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.
|
data/lib/jekyll/galleries.rb
CHANGED
@@ -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['
|
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 =
|
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
|
|