jekyll-exif-data 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2421850c2a1d15a7c323d7bcb5af2aeaf5fee080da1a70745a353e114f09d48
4
- data.tar.gz: 698037256bfd592ea6540f1d419f34c27e01e841f16058251791768437612c0a
3
+ metadata.gz: fc0b10dd079596d62d32c264461f6a29c80b17684d35b25f7b71b3adc2bfcba6
4
+ data.tar.gz: 9fee8fa8670ebe22c14d13510210c59ad2f1a03b8eb9b5a4d1f27a3dd7a14c71
5
5
  SHA512:
6
- metadata.gz: 8785ba40dcf425bad0e9e7fed1e0738f5a1c8758a4f30261cd5ef1229b831bb219e6c0c58152615eb4976f7d3e81951d26c70096d6fde935af985394a2876309
7
- data.tar.gz: f1ed9c24107dd74f798e2ab9b4ca2c6bf12420b050ab468148e9a9122884dfcb49197995662fd1c0fd615e5790a6541c661f81156e98cbda44137abe9d4c15d6
6
+ metadata.gz: cbeffe8351e84c812a4ec93678021a63027c7ec811e6b6b38a362264cde8a1e1f39e9f38aa68d54364bc09e4a6957eef49c34306f63f638cf3d817e3ab751524
7
+ data.tar.gz: e7ed691c85caf95687f499eb3e0e0cbc377681269e598bc2b361d9e327ff0a3cd0ee3fce5d9d439aaa076c62afa7123c52f0af47febbe729f044680755190e23
data/README.md CHANGED
@@ -1,40 +1,57 @@
1
1
  # Jekyll-exif-data
2
2
 
3
- This Jekyll plugin adds the Liquid filter `exif`, supplying exif data to Jekyll websites. To read the data [exifr](https://github.com/remvee/exifr) is needed as a dependency.
3
+ [![Gem Version](https://badge.fury.io/rb/jekyll-exif-data.svg)](https://badge.fury.io/rb/jekyll-exif-data)
4
+
5
+ This Jekyll plugin adds the Liquid filter `exif`, supplying exif data to Jekyll websites. To read the data [exifr](https://github.com/remvee/exifr) is used as a dependency.
4
6
 
5
7
  ## Installation
6
8
 
7
9
  Add the plugin to your site's Gemfile:
8
- ```
10
+ ```ruby
9
11
  group :jekyll_plugins do
10
12
  # your other jekyll plugins...
11
13
  gem 'jekyll-exif-data', '~> 0.0'
12
14
  end
13
15
  ```
14
- Then run ```$ bundler install```. The dependency of the plugin is also automatically installed by this command.
15
-
16
- <br><br>
17
16
 
18
- Or install it:
17
+ Then run
18
+ ```bash
19
+ $ bundle install
19
20
  ```
21
+ in your jekyll project directory. The dependency of the plugin is also automatically installed by this command.
22
+
23
+ ### Manual installation
24
+ In your terminal:
25
+ ```bash
20
26
  $ gem install jekyll-exif-data
21
27
  ```
22
28
 
29
+ Then add the plugin to your `_config` file:
30
+ ```yml
31
+ plugins:
32
+ - jekyll-exif-data
33
+ ```
34
+
35
+
36
+
23
37
  ## Usage
38
+ ```Liquid
39
+ {{ image_path | exif: '[exif-tag]'}}
40
+ ```
24
41
 
25
- The `exif` filter takes the exif tag as the argument and acts on the path to the image (no leading slash).
42
+ The `exif` filter takes the exif tag as the argument and acts on the image (path without leading slash).
26
43
 
27
44
  Examples:
28
- ```
45
+ ```Liquid
29
46
  {% assign image_path = "assets/my_image.jpg" %}
30
47
  {{ image_path | exif: 'model'}}
31
- {{ "assets/images/example.jpg" | exif: 'model'}}
48
+ {{ "assets/images/example.jpg" | exif: 'date_time' | date: "%Y" }}
32
49
  ```
33
50
 
34
51
  For more examples of possible exif tags see [exifr](https://github.com/remvee/exifr). The argument taken by the `exif` filter is the name of the method in exifr (for deeper methods join them with a dot e.g. `gps.latitude` or `f_number.to_f`).
35
52
 
36
- You can use the arguments `exif?` and `gps?` to figure out whether there is any exif/gps data for your image:
37
- ```
53
+ You can use the arguments `exif?` and `gps?` to figure out whether there is any exif/gps data for your image. The code shown below links to the location on https://www.openstreetmap.org where the image was taken and additionally provides the model of the camera used and the year.
54
+ ```Liquid
38
55
  {% capture has_exif %}{{ image-path-no-leading-slash | exif: "exif?" }}{% endcapture %}
39
56
  {% capture has_gps %}{{ image-path-no-leading-slash | exif: "gps?" }}{% endcapture %}
40
57
  {% if has_exif %}
@@ -42,8 +59,9 @@ You can use the arguments `exif?` and `gps?` to figure out whether there is any
42
59
  {% if has_gps=="true" %}
43
60
  <a href="https://www.openstreetmap.org/?mlat={{ image-path-no-leading-slash | exif: 'gps.latitude' }}&mlon={{ image-path-no-leading-slash | exif: 'gps.longitude' }}&zoom=8&layers=M" target="_blank">here </a>
44
61
  {% endif %}
45
- with a {{ image-path-no-leading-slash | exif: 'model' }}.
62
+ with a {{ image-path-no-leading-slash | exif: 'model' }}
63
+ in {{ image-path-no-leading-slash | exif: 'date_time' | date: "%Y" }}.
46
64
  {% endif %}
47
65
  ```
48
66
 
49
- If the exif tag exists, but there is no value saved for it "nil" is returned.
67
+ If the exif tag exists, but there is no value saved for it an empty String is returned opposed to `nil` by exifr.
@@ -12,7 +12,7 @@ module Jekyll
12
12
  end
13
13
  answer = exiftag.split('.').inject(exif){|exif,tag| exif.send(tag)}
14
14
  if(answer == nil)
15
- return "nil"
15
+ return ""
16
16
  else
17
17
  return answer
18
18
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module ExifData
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-exif-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Niklas Eicker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-24 00:00:00.000000000 Z
11
+ date: 2019-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: liquid
@@ -66,8 +66,7 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.3'
69
- description: jekyll-exif-data adds the Liquid filter exif which uses exirf to read
70
- the exif data of an image
69
+ description: Provides exif data for images in Jekyll websites via a Liquid filter
71
70
  email:
72
71
  - hello@nikl.me
73
72
  executables: []
@@ -79,8 +78,6 @@ files:
79
78
  - lib/jekyll-exif-data.rb
80
79
  - lib/jekyll/exif-data.rb
81
80
  - lib/jekyll/exif-data/version.rb
82
- - spec/jekyll-exif-data_spec.rb
83
- - spec/spec_helper.rb
84
81
  homepage: https://github.com/NiklasEi/jekyll-exif-data
85
82
  licenses:
86
83
  - MIT
@@ -89,6 +86,7 @@ metadata:
89
86
  documentation_uri: https://github.com/NiklasEi/jekyll-exif-data
90
87
  homepage_uri: https://github.com/NiklasEi/jekyll-exif-data
91
88
  source_code_uri: https://github.com/NiklasEi/jekyll-exif-data
89
+ changelog_uri: https://github.com/NiklasEi/jekyll-exif-data/blob/master/changelog.md
92
90
  post_install_message:
93
91
  rdoc_options: []
94
92
  require_paths:
@@ -107,7 +105,7 @@ requirements: []
107
105
  rubygems_version: 3.0.3
108
106
  signing_key:
109
107
  specification_version: 4
110
- summary: jekyll-exif-data makes exif data accessible for jekyll sites
111
- test_files:
112
- - spec/jekyll-exif-data_spec.rb
113
- - spec/spec_helper.rb
108
+ summary: This plugin provides exif data for images in Jekyll websites via a Liquid
109
+ filter using exifr. For source code, issues, and example usages please refer to
110
+ the GitHub repository.
111
+ test_files: []
@@ -1,25 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe(Jekyll::EmailProtect::EmailProtectionFilter) do
4
- let(:output) do
5
- render_liquid(content, {'email' => email})
6
- end
7
-
8
- context "simple example address" do
9
- let(:email) { "example@example.com" }
10
- let(:content) { "{{ '#{email}' | encode_email }}" }
11
-
12
- it "produces the correct percent-encoded email" do
13
- expect(output).to eq("%65%78%61%6D%70%6C%65@%65%78%61%6D%70%6C%65.%63%6F%6D")
14
- end
15
- end
16
-
17
- context "example address with plus and dash" do
18
- let(:email) { "example-person+spam@example.com" }
19
- let(:content) { "{{ '#{email}' | encode_email }}" }
20
-
21
- it "produces the correct percent-encoded email" do
22
- expect(output).to eq("%65%78%61%6D%70%6C%65-%70%65%72%73%6F%6E+%73%70%61%6D@%65%78%61%6D%70%6C%65.%63%6F%6D")
23
- end
24
- end
25
- end
@@ -1,15 +0,0 @@
1
- TEST_DIR = File.dirname(__FILE__)
2
-
3
- require 'liquid'
4
- require File.expand_path("../lib/jekyll-email-protect.rb", TEST_DIR)
5
-
6
- RSpec.configure do |config|
7
- config.run_all_when_everything_filtered = true
8
- config.filter_run :focus
9
- config.order = 'random'
10
-
11
- def render_liquid(content, variables)
12
- template = Liquid::Template.parse(content)
13
- template.render(variables)
14
- end
15
- end