Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified bin/linux-x64-cwebp
100644 → 100755
Empty file.
Empty file modified bin/linux-x86-cwebp
100644 → 100755
Empty file.
Empty file modified bin/osx-cwebp
100644 → 100755
Empty file.
Empty file modified bin/win-x64-cwebp.exe
100644 → 100755
Empty file.
Empty file modified bin/win-x86-cwebp.exe
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions jekyll-webp.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# coding: utf-8
require 'date'
require_relative 'lib/jekyll-webp/version'

Gem::Specification.new do |spec|
Expand All @@ -23,4 +24,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "bundler", "~> 1.5"
spec.add_development_dependency "rake", "~> 1.5"
spec.add_development_dependency "minitest", '~> 5.4', '>= 5.4.3'
spec.add_runtime_dependency "image_size", "~> 2.0"
end
9 changes: 7 additions & 2 deletions lib/jekyll-webp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
require "jekyll-webp/webpExec"
require "jekyll-webp/webpGenerator"

module Jekyll
module Jekyll
module Webp
end # module Webp
end # module Jekyll
end # module Jekyll

# Register the post-write hook
Jekyll::Hooks.register :site, :post_write do |site|
Jekyll::Webp::WebpProcessor.new(site).process
end
19 changes: 8 additions & 11 deletions lib/jekyll-webp/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ module Webp
# https://developers.google.com/speed/webp/docs/cwebp#options
'flags' => "-m 4 -pass 4 -af",

# List of directories containing images to optimize, Nested directories only be checked if `nested` is true
'img_dir' => ["/img"],

# Whether to search in nested directories or not
'nested' => false,

# add ".gif" to the format list to generate webp for animated gifs as well
# File extensions of images to convert to WebP
'formats' => [".jpeg", ".jpg", ".png", ".tiff"],

# append .webp to existing extension instead of replacing it
Expand All @@ -37,13 +31,16 @@ module Webp
# Leave as nil to use the cmd line utilities shipped with the gem, override to use your local install
'webp_path' => nil,

# List of files or directories to exclude
# List of files or directories to exclude from WebP generation
# e.g. custom or hand generated webp conversion files
'exclude' => [],

# List of files or directories to explicitly include
# e.g. single files outside of the main image directories
'include' => []
# Generate thumbnail versions with maximum dimension of 800px (height or width)
'thumbnails' => false,

# Number of threads to use for parallel generation.
# 0 or 1 means sequential (no parallelism).
'threads' => 0
}

end # module Webp
Expand Down
4 changes: 2 additions & 2 deletions lib/jekyll-webp/version.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module Jekyll
module Webp
VERSION = "1.0.0"
VERSION = "1.0.1"
# When modifying remember to issue a new tag command in git before committing, then push the new tag
# git tag -a v1.0.0 -m "Gem v1.0.0"
# git tag -a v1.0.1 -m "Gem v1.0.1"
# git push origin --tags
end #module Webp
end #module Jekyll
Loading