jekyll-galleries 0.8.0 → 0.8.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 +4 -4
- data/ChangeLog +4 -0
- data/lib/jekyll/galleries.rb +9 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97094652304097fd23bedda6bd418b77c8aa6c36
|
4
|
+
data.tar.gz: 5e750d11dfc95fbef20ad81222bc5f62ea46948e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0298c72a757f8b41a5cacb7fa15d0b3d83b178a948743146828d4ad8eafe2a46504861ea881714fb1c6c80059d17d7f5b5568931b28ebdb29d97e19d8d965ab7
|
7
|
+
data.tar.gz: c063ffd4cb8d39d9a77133d90ce44425d47ee9b164852db4457a0c74f74b46f436f7e4ff5c66a74fb144b5abd1f7bc061ac06fffa65dd11cc8eaccdcb94f3ea1
|
data/ChangeLog
CHANGED
data/lib/jekyll/galleries.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'RMagick'
|
2
|
+
require 'exifr'
|
2
3
|
include Magick
|
3
|
-
|
4
4
|
include FileUtils
|
5
5
|
|
6
6
|
module Jekyll
|
@@ -25,7 +25,6 @@ module Jekyll
|
|
25
25
|
site.data['galleries'] = []
|
26
26
|
|
27
27
|
gallery_dirs = Dir["#{site.source}/#{gallery_dir}/*/"].select { |e| File.directory? e }
|
28
|
-
gallery_dirs.reverse! # in order to sort by date desc
|
29
28
|
gallery_dirs.each do |dir|
|
30
29
|
generate_gallery_page(dir)
|
31
30
|
end
|
@@ -90,12 +89,17 @@ module Jekyll
|
|
90
89
|
self.data['url'] = URI.escape self.url
|
91
90
|
|
92
91
|
# For each photo, initial attributes are `filename` and `url`
|
93
|
-
photos = Dir["#{self.gallery_dir}/*"].map { |e| { filename: File.basename(e), url: URI.escape("/#{self.gen_dir}/#{self.gallery_dir_name}/#{File.basename e}") } } # basic photos attributes
|
92
|
+
photos = Dir["#{self.gallery_dir}/*"].map { |e| { file: File.new(e), filename: File.basename(e), url: URI.escape("/#{self.gen_dir}/#{self.gallery_dir_name}/#{File.basename e}") } } # basic photos attributes
|
94
93
|
|
95
94
|
self.data['photos'] = [] # storing an array of Photo
|
96
95
|
photos.each do |photo|
|
97
|
-
photo_data = {}
|
98
96
|
photo_data = photos_config.find { |e| e['filename'] == photo[:filename] } if photos_config
|
97
|
+
photo_data ||= {}
|
98
|
+
begin
|
99
|
+
photo_data['date'] = EXIFR::JPEG.new(photo[:file].path).date_time.strftime("%F %R")
|
100
|
+
rescue
|
101
|
+
puts "#{photo[:file].path}: cannot load date"
|
102
|
+
end
|
99
103
|
|
100
104
|
self.data['photos'] << Photo.new(@site, photo[:filename], self, photo_data)
|
101
105
|
end
|
@@ -145,7 +149,6 @@ module Jekyll
|
|
145
149
|
self.data['filename'] = filename
|
146
150
|
self.filename = filename
|
147
151
|
|
148
|
-
|
149
152
|
@thumbs_dir = site.config['thumbnails_dir']
|
150
153
|
generate_thumbnails if @thumbs_dir
|
151
154
|
|
@@ -159,7 +162,7 @@ module Jekyll
|
|
159
162
|
size_x = @site.config['thumbnail_x'] || 100
|
160
163
|
size_y = @site.config['thumbnail_y'] || 100
|
161
164
|
|
162
|
-
full_thumbs_path = "#{@
|
165
|
+
full_thumbs_path = "#{@thumbs_dir}/#{@gallery.gallery_dir_name}"
|
163
166
|
FileUtils.mkdir_p(full_thumbs_path, :mode => 0755)
|
164
167
|
if File.file?("#{full_thumbs_path}/#{self.filename}") == false or File.mtime("#{@gallery.gallery_dir}/#{self.filename}") > File.mtime("#{full_thumbs_path}/#{self.filename}")
|
165
168
|
begin
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-galleries
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- allenlsy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Jekyll plugin to automatically generate photo gallery (album) from image
|
14
14
|
folder.
|
@@ -32,7 +32,7 @@ rdoc_options:
|
|
32
32
|
- --line-numbers
|
33
33
|
- --all
|
34
34
|
- --title
|
35
|
-
- jekyll-galleries Application documentation (v0.8.
|
35
|
+
- jekyll-galleries Application documentation (v0.8.1)
|
36
36
|
- --main
|
37
37
|
- ChangeLog
|
38
38
|
require_paths:
|