Permalink
Browse files

updates, tweaks, fixes

  • Loading branch information...
1 parent e60216f commit 20fe40248c1b57ac8a3048e13a40a11f84dfe493 @matthewowen committed Aug 7, 2012
Showing with 14 additions and 7 deletions.
  1. +1 −1 _config.yml
  2. +11 −6 _plugins/jekyll_slideshow.rb
  3. +2 −0 jesl/jesl.js
View
@@ -1,3 +1,3 @@
slideshow:
- width: 100
+ width: 150
height: 100
@@ -14,15 +14,20 @@ def generate(site)
else
config = Hash["width", 100, "height", 100]
end
+ to_thumb = Array.new
site.static_files.each do |file|
- if File.extname(file.path).downcase == ('.jpg' || '.png') && file.path.index("-thumb") == nil
- img = Magick::Image::read(file.path).first
- thumb = img.resize_to_fill(config['width'], config['height'])
- path = file.path.sub(File.extname(file.path), '-thumb' << File.extname(file.path))
- thumb.write path
- site.static_files << StaticFile.new(thumb, site.source, File.dirname(file.path).sub(site.source, ''), File.basename(file.path).sub('.JPG', '-thumb.JPG'))
+ if (File.extname(file.path).downcase == ('.jpg' || '.png')) && (!File.basename(file.path).include? "-thumb")
+ to_thumb.push(file)
end
end
+ to_thumb.each do |file|
+ img = Magick::Image::read(file.path).first
+ thumb = img.resize_to_fill(config['width'], config['height'])
+ path = file.path.sub(File.extname(file.path), '-thumb' << File.extname(file.path))
+ thumb.write path
+ site.static_files << StaticFile.new(thumb, site.source, File.dirname(file.path).sub(site.source, ''), File.basename(file.path).sub('.JPG', '-thumb.JPG'))
+ puts file
+ end
end
end
View
@@ -119,6 +119,8 @@ function jekyllSlideshow() {
jesl.init();
}
+
+
$(document).ready(function () {
'use strict';
jekyllSlideshow();

0 comments on commit 20fe402

Please sign in to comment.