jekyll-linkpreview 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yaml +39 -0
- data/Appraisals +18 -6
- data/README.md +5 -0
- data/jekyll-linkpreview.gemspec +1 -0
- data/lib/jekyll-linkpreview/version.rb +1 -1
- data/lib/jekyll-linkpreview.rb +11 -5
- metadata +18 -11
- data/.travis.yml +0 -22
- data/gemfiles/.bundle/config +0 -2
- data/gemfiles/jekyll_35.gemfile +0 -7
- data/gemfiles/jekyll_36.gemfile +0 -7
- data/gemfiles/jekyll_37.gemfile +0 -7
- data/gemfiles/jekyll_38.gemfile +0 -7
- data/gemfiles/jekyll_40.gemfile +0 -7
- data/gemfiles/jekyll_41.gemfile +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6145c1a65dbaab48f8d1ce4b96e819ab91a1c9ccc17ee677a345c89cf5c3c15a
|
4
|
+
data.tar.gz: 0b6dea42bd3b46a9b3a4d5dd0ff5a4a9eac69221bc6f810ebcddedfe80d6d133
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5155c52c70a23ae14be7b650b8bd04b64458c2a2e3ffb076b339701a0f7042ab36452bdc1a68f80bf4b8a116e377c3162522c86a69268ab1afb1a17c68e30265
|
7
|
+
data.tar.gz: 4ee825fc487c1b0f98e9f8696210730972918db867b4a5065d533f68ae0b958d81f539e54edb013d7107cd03f788204d360de28450a763916341044bfdaffe25
|
@@ -0,0 +1,39 @@
|
|
1
|
+
name: Test
|
2
|
+
on: [push]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
container:
|
6
|
+
image: ruby:${{ matrix.ruby }}
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
matrix:
|
10
|
+
ruby: ["2.7", "3.1"]
|
11
|
+
appraisal:
|
12
|
+
- jekyll-35
|
13
|
+
- jekyll-36
|
14
|
+
- jekyll-37
|
15
|
+
- jekyll-38
|
16
|
+
- jekyll-39
|
17
|
+
- jekyll-40
|
18
|
+
- jekyll-41
|
19
|
+
- jekyll-42
|
20
|
+
- jekyll-43
|
21
|
+
exclude:
|
22
|
+
# To prevent 'cannot load such file -- rexml/parsers/baseparser'
|
23
|
+
- ruby: "3.1"
|
24
|
+
appraisal: jekyll-35
|
25
|
+
- ruby: "3.1"
|
26
|
+
appraisal: jekyll-36
|
27
|
+
- ruby: "3.1"
|
28
|
+
appraisal: jekyll-37
|
29
|
+
- ruby: "3.1"
|
30
|
+
appraisal: jekyll-38
|
31
|
+
steps:
|
32
|
+
- name: Checkout
|
33
|
+
uses: actions/checkout@v3
|
34
|
+
- name: Install dependencies
|
35
|
+
run: bundle install
|
36
|
+
- name: Install dependencies for each appraisal
|
37
|
+
run: bundle exec appraisal install
|
38
|
+
- name: Run tests
|
39
|
+
run: bundle exec appraisal ${{ matrix.appraisal }} rake test
|
data/Appraisals
CHANGED
@@ -1,23 +1,35 @@
|
|
1
1
|
appraise "jekyll-35" do
|
2
|
-
gem "jekyll", "3.5.2"
|
2
|
+
gem "jekyll", "~> 3.5.2"
|
3
3
|
end
|
4
4
|
|
5
5
|
appraise "jekyll-36" do
|
6
|
-
gem "jekyll", "3.6.3"
|
6
|
+
gem "jekyll", "~> 3.6.3"
|
7
7
|
end
|
8
8
|
|
9
9
|
appraise "jekyll-37" do
|
10
|
-
gem "jekyll", "3.7.4"
|
10
|
+
gem "jekyll", "~> 3.7.4"
|
11
11
|
end
|
12
12
|
|
13
13
|
appraise "jekyll-38" do
|
14
|
-
gem "jekyll", "3.8.7"
|
14
|
+
gem "jekyll", "~> 3.8.7"
|
15
|
+
end
|
16
|
+
|
17
|
+
appraise "jekyll-39" do
|
18
|
+
gem "jekyll", "~> 3.9.1"
|
15
19
|
end
|
16
20
|
|
17
21
|
appraise "jekyll-40" do
|
18
|
-
gem "jekyll", "4.0.1"
|
22
|
+
gem "jekyll", "~> 4.0.1"
|
19
23
|
end
|
20
24
|
|
21
25
|
appraise "jekyll-41" do
|
22
|
-
gem "jekyll", "4.1.
|
26
|
+
gem "jekyll", "~> 4.1.1"
|
27
|
+
end
|
28
|
+
|
29
|
+
appraise "jekyll-42" do
|
30
|
+
gem "jekyll", "~> 4.2.2"
|
31
|
+
end
|
32
|
+
|
33
|
+
appraise "jekyll-43" do
|
34
|
+
gem "jekyll", "~> 4.3.1"
|
23
35
|
end
|
data/README.md
CHANGED
@@ -34,6 +34,7 @@ See https://jekyllrb.com/docs/plugins/installation/ .
|
|
34
34
|
## Usage
|
35
35
|
|
36
36
|
1. Create `_cache` directory.
|
37
|
+
* This directory _must_ exist under your project root even if you've modified the [site source](https://jekyllrb.com/docs/configuration/options/).
|
37
38
|
|
38
39
|
1. Embed [linkpreview.css](assets/css/linkpreview.css) into your Website.
|
39
40
|
|
@@ -49,6 +50,8 @@ You can override the default templates used for generating previews, both in cas
|
|
49
50
|
### Template for pages where Open Graph protocol metadata exists
|
50
51
|
|
51
52
|
1. Place `linkpreview.html` file inside `_includes/` folder of your Jekyll site (`_includes/linkpreview.html`)
|
53
|
+
* The folder is the same one you would store files for use with `{% include fragment.html %}` tag.
|
54
|
+
Therefore, it *must* be under the [site's source](https://jekyllrb.com/docs/configuration/options/).
|
52
55
|
|
53
56
|
2. Use built-in variables to extract data which you would like to render. Available variables are:
|
54
57
|
* **link_url** i.e. `{{ link_url }}`
|
@@ -60,6 +63,8 @@ You can override the default templates used for generating previews, both in cas
|
|
60
63
|
### Template for pages where Open Graph protocol metadata does not exist
|
61
64
|
|
62
65
|
1. Place `linkpreview_nog.html` file inside `_includes/` folder of your Jekyll site (`_includes/linkpreview_nog.html`)
|
66
|
+
* The folder is the same one you would store files for use with `{% include fragment.html %}` tag.
|
67
|
+
Therefore, it *must* be under the [site's source](https://jekyllrb.com/docs/configuration/options/).
|
63
68
|
|
64
69
|
2. Use built-in variables to extract data which you would like to render. Available variables are:
|
65
70
|
* **link_url** i.e. `{{ link_url }}`
|
data/jekyll-linkpreview.gemspec
CHANGED
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 2.0"
|
24
24
|
spec.add_development_dependency "rake", "~> 12.3.3"
|
25
25
|
spec.add_development_dependency "rspec", "~> 3.0"
|
26
|
+
spec.add_development_dependency "rspec-parameterized", "~> 0.5.2"
|
26
27
|
spec.add_development_dependency "appraisal", "~> 2.2.0"
|
27
28
|
spec.add_development_dependency "wwtd", "~> 1.4.1"
|
28
29
|
end
|
data/lib/jekyll-linkpreview.rb
CHANGED
@@ -147,7 +147,7 @@ module Jekyll
|
|
147
147
|
def render(context)
|
148
148
|
url = get_url_from(context)
|
149
149
|
properties = get_properties(url)
|
150
|
-
render_linkpreview properties
|
150
|
+
render_linkpreview context, properties
|
151
151
|
end
|
152
152
|
|
153
153
|
def get_properties(url)
|
@@ -208,8 +208,8 @@ module Jekyll
|
|
208
208
|
end
|
209
209
|
|
210
210
|
private
|
211
|
-
def render_linkpreview(properties)
|
212
|
-
template_path = get_custom_template_path properties
|
211
|
+
def render_linkpreview(context, properties)
|
212
|
+
template_path = get_custom_template_path context, properties
|
213
213
|
if File.exist?(template_path)
|
214
214
|
hash = properties.to_hash_for_custom_template
|
215
215
|
gen_custom_template template_path, hash
|
@@ -219,8 +219,14 @@ module Jekyll
|
|
219
219
|
end
|
220
220
|
|
221
221
|
private
|
222
|
-
def get_custom_template_path(properties)
|
223
|
-
|
222
|
+
def get_custom_template_path(context, properties)
|
223
|
+
source_dir = get_source_dir_from context
|
224
|
+
File.join source_dir, @@template_dir, properties.template_file
|
225
|
+
end
|
226
|
+
|
227
|
+
private
|
228
|
+
def get_source_dir_from(context)
|
229
|
+
File.absolute_path context.registers[:site].config['source'], Dir.pwd
|
224
230
|
end
|
225
231
|
|
226
232
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-linkpreview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yusuke Nishioka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -86,6 +86,20 @@ dependencies:
|
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '3.0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: rspec-parameterized
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 0.5.2
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 0.5.2
|
89
103
|
- !ruby/object:Gem::Dependency
|
90
104
|
name: appraisal
|
91
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -121,9 +135,9 @@ executables: []
|
|
121
135
|
extensions: []
|
122
136
|
extra_rdoc_files: []
|
123
137
|
files:
|
138
|
+
- ".github/workflows/test.yaml"
|
124
139
|
- ".gitignore"
|
125
140
|
- ".rspec"
|
126
|
-
- ".travis.yml"
|
127
141
|
- Appraisals
|
128
142
|
- Dockerfile
|
129
143
|
- Gemfile
|
@@ -133,13 +147,6 @@ files:
|
|
133
147
|
- assets/css/linkpreview.css
|
134
148
|
- bin/console
|
135
149
|
- bin/setup
|
136
|
-
- gemfiles/.bundle/config
|
137
|
-
- gemfiles/jekyll_35.gemfile
|
138
|
-
- gemfiles/jekyll_36.gemfile
|
139
|
-
- gemfiles/jekyll_37.gemfile
|
140
|
-
- gemfiles/jekyll_38.gemfile
|
141
|
-
- gemfiles/jekyll_40.gemfile
|
142
|
-
- gemfiles/jekyll_41.gemfile
|
143
150
|
- jekyll-linkpreview.gemspec
|
144
151
|
- lib/jekyll-linkpreview.rb
|
145
152
|
- lib/jekyll-linkpreview/version.rb
|
@@ -162,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
169
|
- !ruby/object:Gem::Version
|
163
170
|
version: '0'
|
164
171
|
requirements: []
|
165
|
-
rubygems_version: 3.
|
172
|
+
rubygems_version: 3.3.26
|
166
173
|
signing_key:
|
167
174
|
specification_version: 4
|
168
175
|
summary: Jekyll tag plugin to generate link preview
|
data/.travis.yml
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
---
|
2
|
-
sudo: false
|
3
|
-
language: ruby
|
4
|
-
cache: bundler
|
5
|
-
rvm:
|
6
|
-
- 2.4.2
|
7
|
-
- 2.7.0
|
8
|
-
before_install: gem install bundler -v 2.0.1
|
9
|
-
gemfile:
|
10
|
-
- gemfiles/jekyll_35.gemfile
|
11
|
-
- gemfiles/jekyll_36.gemfile
|
12
|
-
- gemfiles/jekyll_37.gemfile
|
13
|
-
- gemfiles/jekyll_38.gemfile
|
14
|
-
- gemfiles/jekyll_40.gemfile
|
15
|
-
- gemfiles/jekyll_41.gemfile
|
16
|
-
script: "bundle exec rake test"
|
17
|
-
matrix:
|
18
|
-
exclude:
|
19
|
-
- rvm: 2.4.2
|
20
|
-
gemfile: gemfiles/jekyll_40.gemfile
|
21
|
-
- rvm: 2.4.2
|
22
|
-
gemfile: gemfiles/jekyll_41.gemfile
|
data/gemfiles/.bundle/config
DELETED
data/gemfiles/jekyll_35.gemfile
DELETED
data/gemfiles/jekyll_36.gemfile
DELETED
data/gemfiles/jekyll_37.gemfile
DELETED
data/gemfiles/jekyll_38.gemfile
DELETED
data/gemfiles/jekyll_40.gemfile
DELETED