-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from xfxf/master
Fixes issues #1, 8, 9, 10, 11, 12, 13
- Loading branch information
Showing
43 changed files
with
246 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2.2.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'jekyll', '~> 2.0.3' | ||
gem 'kramdown', '~> 1.3.3' | ||
gem 'rake', '~> 10.1.1' | ||
gem 'jekyll', '~> 2.0.3' | ||
gem 'kramdown', '~> 1.3.3' | ||
gem 'rake', '~> 10.1.1' | ||
gem 'mini_magick', '~> 4.2.5' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="col-sm-12"> | ||
<div class="panel-default"> | ||
<div class="top-message"> | ||
The <a href="../numato-opsis">Numato Opsis board</a>, the first open hardware for the HDMI2USB will soon be available to purchase.<br> | ||
<a href="http://bit.ly/get-opsis" class="btn btn-danger">Sign up for Numato Opsis updates</a> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | ||
<script src="{{ "/js/bootstrap.min.js" | prepend: site.baseurl }}"></script> | ||
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | ||
<script type="text/javascript" src="{{ "/js/bootstrap.min.js" | prepend: site.baseurl }}"></script> | ||
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery.slick/1.5.7/slick.min.js"></script> | ||
<script type="text/javascript" src="{{ "/js/app.js" | prepend: site.baseurl }}"></script> | ||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.pack.js?v=2.1.5"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
layout: base | ||
--- | ||
<div class="padding"> | ||
<div class="col-sm-12"> | ||
<div class="panel panel-default"> | ||
<div class="panel-body"> | ||
{{ content }} | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Generates a thumbnail to an image and renders an image tag. | ||
# The image will be resized to fit within a max bounding box. | ||
# The resulting filename is based on original and includes dimensions. | ||
# All paths are relative to /source. | ||
|
||
# Usage: | ||
# | ||
# {% thumbnail /path/to/local/image.png 50x50< %} | ||
# | ||
# The dimensions will be given directly to imagemagick. | ||
# You probably want the "<" at the end. See http://www.imagemagick.org/Magick++/Geometry.html. | ||
# | ||
# Installation: | ||
# | ||
# * add the gem: gem "mini_magick" (and bundle install) | ||
# * copy thumbnail.rb to plugins folder | ||
# | ||
# https://github.com/xfxf/jekyll-thumbnailer | ||
|
||
require 'mini_magick' | ||
|
||
class Jekyll::Thumbnail < Liquid::Tag | ||
def initialize(tag_name, markup, tokens) | ||
if /(?<source>[^\s]+)\s+(?<dimensions>[^\s]+)/i =~ markup | ||
@source = source | ||
@dimensions = dimensions | ||
end | ||
super | ||
end | ||
|
||
def render(context) | ||
if @source | ||
|
||
# parking | ||
source = @source | ||
dimensions = @dimensions | ||
|
||
raise "#{source} is not readable" unless File.readable?(source) | ||
ext = File.extname(source) | ||
desc = dimensions.gsub(/[^\da-z]+/i, '') | ||
w, h = desc.split('x') | ||
|
||
dest = "#{File.dirname(source)}/#{File.basename(source, ext)}_#{desc}#{ext}" | ||
|
||
# only thumbnail the image if it doesn't exist tor is less recent than the source file | ||
# will prevent re-processing thumbnails for a ton of images... | ||
if !File.exists?(dest) || File.mtime(dest) <= File.mtime(source) | ||
# puts ENV.inspect | ||
|
||
puts "Thumbnailing #{source} to #{dest} (#{dimensions})" | ||
|
||
MiniMagick::Tool::Convert.new do |convert| | ||
convert << source | ||
convert.resize dimensions | ||
convert.gravity 'center' | ||
convert.extent dimensions | ||
convert << dest | ||
end | ||
|
||
end | ||
|
||
"""<img src='/#{dest}' width='#{w}' height='#{h}'/>""" | ||
|
||
else | ||
"Could not create thumbnail for #{source}. Usage: thumbnail /path/to/local/image.png 50x50<" | ||
end | ||
end | ||
end | ||
|
||
Liquid::Template.register_tag('thumbnail', Jekyll::Thumbnail) |
Oops, something went wrong.