Skip to content

Commit f01512c

Browse files
committed
v 0.0.4 fix error when no exiftag config given in config file
1 parent 6a6170c commit f01512c

4 files changed

+9
-9
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ These paths are relative to your sites root. Don't add leading and trailing slas
3939
4040
## License
4141
42-
Copyright (C) 2013 Beni Buess (http://benel.net/)
42+
Copyright (C) 2013 - 2015 Beni Buess (http://benel.net/)
4343
4444
The MIT License
4545

jekyll-exiftag-0.0.4.gem

5.5 KB
Binary file not shown.

jekyll-exiftag.gemspec

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |gem|
22
gem.name = 'jekyll-exiftag'
3-
gem.version = '0.0.3'
4-
gem.date = '2015-06-09'
3+
gem.version = '0.0.4'
4+
gem.date = '2015-10-13'
55
gem.summary = "jekyll-exiftag provides exif data in jekyll sites"
66
gem.description = "jekyll-exiftag is a LiquidTag Extension for Jekyll to get Exif data from images"
77
gem.authors = ["Beni Buess"]
@@ -10,5 +10,5 @@ Gem::Specification.new do |gem|
1010
gem.homepage = 'http://github.com/benib/jekyll-exiftag'
1111

1212
gem.add_dependency "exifr"
13-
13+
1414
end

lib/jekyll-exiftag.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Usage:
77
#
88
# {% exiftag tagname,[source],[file] %}
9-
#
9+
#
1010
# Everything given as tagname is called on EXIFR::JPEG, so this could be model oder f_number.to_f (see https://github.com/remvee/exifr)
1111
# If you give a source, this source is used build the fullpath for the given file (you can also configure them in _config.yml, see below)
1212
# If the file is given, this is the file to get Exif Tags for, this can be alternatively defined in the YAML Front Matter as img: file
@@ -35,7 +35,7 @@ def initialize(tag_name, params, token)
3535

3636
def render(context)
3737
sources = Array.new()
38-
if context.registers[:site].config['exiftag']['sources']
38+
if if context.registers[:site].config['exiftag'] and context.registers[:site].config['exiftag']['sources']
3939
sources.unshift(*context.registers[:site].config['exiftag']['sources'])
4040
end
4141

@@ -46,15 +46,15 @@ def render(context)
4646
if @args.count > 1
4747
sources.unshift(@args[1])
4848
end
49-
49+
5050
# the image can be passed as the third parameter
5151
if @args.count > 2
5252
img = @args[2]
5353
# or be defined in the YAML Front Matter like img: <file>
5454
else
5555
img = context.environments.first["page"]["img"]
5656
end
57-
57+
5858
# first check if the given img is already the path
5959
if File.exist?(img)
6060
file_name = img
@@ -73,7 +73,7 @@ def render(context)
7373
""
7474
end
7575
end
76-
76+
7777
def split_params(params)
7878
params.split(",").map(&:strip)
7979
end

0 commit comments

Comments
 (0)