algoliasearch-jekyll 0.5.3 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/Appraisals +8 -0
- data/CONTRIBUTING.md +15 -7
- data/Gemfile +1 -1
- data/Guardfile +14 -4
- data/README.md +1 -1
- data/algoliasearch-jekyll.gemspec +46 -33
- data/gemfiles/jekyll_v2.gemfile +21 -0
- data/gemfiles/jekyll_v3.gemfile +22 -0
- data/lib/record_extractor.rb +30 -12
- data/lib/version.rb +1 -1
- data/scripts/git_hooks/pre-push +1 -1
- data/scripts/test +4 -0
- data/scripts/test_ci +7 -0
- data/scripts/test_v2 +5 -0
- data/scripts/test_v3 +6 -0
- data/scripts/watch +4 -0
- data/scripts/watch_v2 +4 -0
- data/scripts/watch_v3 +4 -0
- data/spec/credential_checker_spec.rb +1 -1
- data/spec/fixtures/{_config.yml → jekyll_version_2/_config.yml} +4 -0
- data/spec/fixtures/{_layouts → jekyll_version_2/_layouts}/default.html +0 -0
- data/spec/fixtures/{_my-collection → jekyll_version_2/_my-collection}/collection-item.html +0 -0
- data/spec/fixtures/{_my-collection → jekyll_version_2/_my-collection}/collection-item.md +0 -0
- data/spec/fixtures/{_posts → jekyll_version_2/_posts}/2015-07-02-test-post.md +0 -0
- data/spec/fixtures/{_posts → jekyll_version_2/_posts}/2015-07-03-test-post-again.md +0 -0
- data/spec/fixtures/{about.md → jekyll_version_2/about.md} +0 -0
- data/spec/fixtures/{api_key_dir → jekyll_version_2/api_key_dir}/_algolia_api_key +0 -0
- data/spec/fixtures/{_site → jekyll_version_2}/assets/ring.png +0 -0
- data/spec/fixtures/{authors.html → jekyll_version_2/authors.html} +0 -0
- data/spec/fixtures/{excluded.html → jekyll_version_2/excluded.html} +0 -0
- data/spec/fixtures/{hierarchy.md → jekyll_version_2/hierarchy.md} +0 -0
- data/spec/fixtures/{index.html → jekyll_version_2/index.html} +0 -0
- data/spec/fixtures/{page2 → jekyll_version_2/page2}/index.html +0 -0
- data/spec/fixtures/{weight.md → jekyll_version_2/weight.md} +0 -0
- data/spec/fixtures/jekyll_version_3/_config.yml +17 -0
- data/spec/fixtures/jekyll_version_3/_layouts/default.html +6 -0
- data/spec/fixtures/{_site/my-collection → jekyll_version_3/_my-collection}/collection-item.html +5 -1
- data/spec/fixtures/jekyll_version_3/_my-collection/collection-item.md +7 -0
- data/spec/fixtures/jekyll_version_3/_posts/2015-07-02-test-post.md +32 -0
- data/spec/fixtures/jekyll_version_3/_posts/2015-07-03-test-post-again.md +7 -0
- data/spec/fixtures/jekyll_version_3/about.md +34 -0
- data/spec/fixtures/jekyll_version_3/api_key_dir/_algolia_api_key +1 -0
- data/spec/fixtures/{assets → jekyll_version_3/assets}/ring.png +0 -0
- data/spec/fixtures/{_site → jekyll_version_3}/authors.html +4 -0
- data/spec/fixtures/{_site → jekyll_version_3}/excluded.html +4 -0
- data/spec/fixtures/jekyll_version_3/hierarchy.md +35 -0
- data/spec/fixtures/jekyll_version_3/index.html +13 -0
- data/spec/fixtures/jekyll_version_3/page2/index.html +6 -0
- data/spec/fixtures/jekyll_version_3/weight.md +19 -0
- data/spec/record_extractor_spec.rb +131 -5
- data/spec/spec_helper.rb +47 -26
- metadata +56 -43
- data/spec/fixtures/_site/2015/07/02/test-post.html +0 -26
- data/spec/fixtures/_site/2015/07/03/test-post-again.html +0 -3
- data/spec/fixtures/_site/about.html +0 -31
- data/spec/fixtures/_site/hierarchy.html +0 -31
- data/spec/fixtures/_site/index.html +0 -17
- data/spec/fixtures/_site/page2/index.html +0 -40
- data/spec/fixtures/_site/weight.html +0 -15
- data/spec/spec_helper_jekyll.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fc07f49e01332879569776774bc13b38b1fa601
|
4
|
+
data.tar.gz: 05bde1d8646bb06eb04049e5fb322d35c86744c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27a25e5b66d6fbd44450897024bc837de069ae78d1142ad8d12e70def6334f593700299126875ae7bdea4dd8819d5dfee80c5832a7a31332b0d27fde5a611eb9
|
7
|
+
data.tar.gz: cf69b239d17b80fac3af079474b046b929bd5d7582b4e321ad2568b83184ea7f5b24971d62bc895f8206caaa6d2a54c292898e10ac84d8ae7b02763b337c223b
|
data/.travis.yml
CHANGED
data/Appraisals
ADDED
data/CONTRIBUTING.md
CHANGED
@@ -7,18 +7,26 @@ already referenced. If not, feel free to open one.
|
|
7
7
|
We use [pull requests](https://github.com/algolia/algoliasearch-jekyll/pulls)
|
8
8
|
for collaboration. The workflow is as follow:
|
9
9
|
|
10
|
-
- Create a local branch, starting from `
|
11
|
-
- Submit the PR on `
|
10
|
+
- Create a local branch, starting from `develop`
|
11
|
+
- Submit the PR on `develop`
|
12
12
|
- Wait for review
|
13
13
|
- Do the changes requested (if any)
|
14
|
-
- We may ask you to rebase the branch to latest
|
15
|
-
with `master`
|
14
|
+
- We may ask you to rebase the branch to latest `develop` if it gets out of sync
|
16
15
|
- Receive the thanks of the Algolia team :)
|
17
16
|
|
18
17
|
# Development workflow
|
19
18
|
|
20
|
-
After the necessary `bundle install`, you
|
21
|
-
|
19
|
+
After the necessary `bundle install`, you'll also need to run `appraisal
|
20
|
+
install`. This will configure the repository so that tests can be run both from
|
21
|
+
Jekyll 2.5 and Jekyll 3.
|
22
|
+
|
23
|
+
You can then launch:
|
24
|
+
- `./scripts/test_v2` to launch tests on Jekyll v2
|
25
|
+
- `./scripts/test_v3` to launch tests on Jekyll v3
|
26
|
+
- `./scripts/test` to launch tests on both
|
27
|
+
- `./scripts/watch` to start a test watcher (for TDD) for Jekyll v2
|
28
|
+
- `./scripts/watch_v3` to start a test watcher (for TDD) for Jekyll v3 (you
|
29
|
+
cannot run both at the same time)
|
22
30
|
|
23
31
|
If you want to test the plugin on an existing Jekyll website while developping,
|
24
32
|
I suggest updating the website `Gemfile` to point to the correct local directory
|
@@ -42,7 +50,7 @@ This part is for main contributors:
|
|
42
50
|
# Update master and release
|
43
51
|
./scripts/release
|
44
52
|
|
45
|
-
# Install the gem locally
|
53
|
+
# Install the gem locally (optional)
|
46
54
|
rake install
|
47
55
|
```
|
48
56
|
|
data/Gemfile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
3
|
gem 'algoliasearch', '~> 1.4'
|
4
|
+
gem 'appraisal', '~> 2.1.0'
|
4
5
|
gem 'awesome_print', '~> 1.6'
|
5
6
|
gem 'json', '~> 1.8'
|
6
7
|
gem 'nokogiri', '~> 1.6'
|
@@ -10,7 +11,6 @@ group :development do
|
|
10
11
|
gem 'flay', '~> 2.6'
|
11
12
|
gem 'flog', '~> 4.3'
|
12
13
|
gem 'guard-rspec', '~> 4.6'
|
13
|
-
gem 'jekyll', '~> 2.5' # Jekyll custom commands only available from 2.5
|
14
14
|
gem 'jeweler', '~> 2.0'
|
15
15
|
gem 'rspec', '~> 3.0'
|
16
16
|
gem 'rubocop', '~> 0.31'
|
data/Guardfile
CHANGED
@@ -1,7 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
group :jekyll_v3 do
|
2
|
+
guard :rspec, cmd: 'appraisal jekyll-v3 bundle exec rspec --color --format documentation' do
|
3
|
+
watch(%r{^spec/.+_spec\.rb$})
|
4
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
5
|
+
watch('spec/spec_helper.rb') { 'spec' }
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
group :jekyll_v2 do
|
10
|
+
guard :rspec, cmd: 'appraisal jekyll-v2 bundle exec rspec --color --format documentation' do
|
11
|
+
watch(%r{^spec/.+_spec\.rb$})
|
12
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
13
|
+
watch('spec/spec_helper.rb') { 'spec' }
|
14
|
+
end
|
5
15
|
end
|
6
16
|
|
7
17
|
notification :off
|
data/README.md
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: algoliasearch-jekyll 0.
|
5
|
+
# stub: algoliasearch-jekyll 0.6.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "algoliasearch-jekyll"
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.6.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Tim Carry"]
|
14
|
-
s.date = "
|
14
|
+
s.date = "2016-01-11"
|
15
15
|
s.description = "Index all your pages and posts to an Algolia index with `jekyll algolia push`"
|
16
16
|
s.email = "tim@pixelastic.com"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -23,6 +23,7 @@ Gem::Specification.new do |s|
|
|
23
23
|
".rspec",
|
24
24
|
".rubocop.yml",
|
25
25
|
".travis.yml",
|
26
|
+
"Appraisals",
|
26
27
|
"CONTRIBUTING.md",
|
27
28
|
"Gemfile",
|
28
29
|
"Guardfile",
|
@@ -31,6 +32,8 @@ Gem::Specification.new do |s|
|
|
31
32
|
"Rakefile",
|
32
33
|
"algoliasearch-jekyll.gemspec",
|
33
34
|
"docs/travis-settings.png",
|
35
|
+
"gemfiles/jekyll_v2.gemfile",
|
36
|
+
"gemfiles/jekyll_v3.gemfile",
|
34
37
|
"lib/algoliasearch-jekyll.rb",
|
35
38
|
"lib/credential_checker.rb",
|
36
39
|
"lib/push.rb",
|
@@ -42,37 +45,47 @@ Gem::Specification.new do |s|
|
|
42
45
|
"scripts/git_hooks/pre-commit",
|
43
46
|
"scripts/git_hooks/pre-push",
|
44
47
|
"scripts/release",
|
48
|
+
"scripts/test",
|
49
|
+
"scripts/test_ci",
|
50
|
+
"scripts/test_v2",
|
51
|
+
"scripts/test_v3",
|
52
|
+
"scripts/watch",
|
53
|
+
"scripts/watch_v2",
|
54
|
+
"scripts/watch_v3",
|
45
55
|
"spec/credential_checker_spec.rb",
|
46
|
-
"spec/fixtures/_config.yml",
|
47
|
-
"spec/fixtures/_layouts/default.html",
|
48
|
-
"spec/fixtures/_my-collection/collection-item.html",
|
49
|
-
"spec/fixtures/_my-collection/collection-item.md",
|
50
|
-
"spec/fixtures/_posts/2015-07-02-test-post.md",
|
51
|
-
"spec/fixtures/_posts/2015-07-03-test-post-again.md",
|
52
|
-
"spec/fixtures/
|
53
|
-
"spec/fixtures/
|
54
|
-
"spec/fixtures/
|
55
|
-
"spec/fixtures/
|
56
|
-
"spec/fixtures/
|
57
|
-
"spec/fixtures/
|
58
|
-
"spec/fixtures/
|
59
|
-
"spec/fixtures/
|
60
|
-
"spec/fixtures/
|
61
|
-
"spec/fixtures/
|
62
|
-
"spec/fixtures/
|
63
|
-
"spec/fixtures/
|
64
|
-
"spec/fixtures/
|
65
|
-
"spec/fixtures/
|
66
|
-
"spec/fixtures/
|
67
|
-
"spec/fixtures/
|
68
|
-
"spec/fixtures/
|
69
|
-
"spec/fixtures/
|
70
|
-
"spec/fixtures/
|
71
|
-
"spec/fixtures/
|
56
|
+
"spec/fixtures/jekyll_version_2/_config.yml",
|
57
|
+
"spec/fixtures/jekyll_version_2/_layouts/default.html",
|
58
|
+
"spec/fixtures/jekyll_version_2/_my-collection/collection-item.html",
|
59
|
+
"spec/fixtures/jekyll_version_2/_my-collection/collection-item.md",
|
60
|
+
"spec/fixtures/jekyll_version_2/_posts/2015-07-02-test-post.md",
|
61
|
+
"spec/fixtures/jekyll_version_2/_posts/2015-07-03-test-post-again.md",
|
62
|
+
"spec/fixtures/jekyll_version_2/about.md",
|
63
|
+
"spec/fixtures/jekyll_version_2/api_key_dir/_algolia_api_key",
|
64
|
+
"spec/fixtures/jekyll_version_2/assets/ring.png",
|
65
|
+
"spec/fixtures/jekyll_version_2/authors.html",
|
66
|
+
"spec/fixtures/jekyll_version_2/excluded.html",
|
67
|
+
"spec/fixtures/jekyll_version_2/hierarchy.md",
|
68
|
+
"spec/fixtures/jekyll_version_2/index.html",
|
69
|
+
"spec/fixtures/jekyll_version_2/page2/index.html",
|
70
|
+
"spec/fixtures/jekyll_version_2/weight.md",
|
71
|
+
"spec/fixtures/jekyll_version_3/_config.yml",
|
72
|
+
"spec/fixtures/jekyll_version_3/_layouts/default.html",
|
73
|
+
"spec/fixtures/jekyll_version_3/_my-collection/collection-item.html",
|
74
|
+
"spec/fixtures/jekyll_version_3/_my-collection/collection-item.md",
|
75
|
+
"spec/fixtures/jekyll_version_3/_posts/2015-07-02-test-post.md",
|
76
|
+
"spec/fixtures/jekyll_version_3/_posts/2015-07-03-test-post-again.md",
|
77
|
+
"spec/fixtures/jekyll_version_3/about.md",
|
78
|
+
"spec/fixtures/jekyll_version_3/api_key_dir/_algolia_api_key",
|
79
|
+
"spec/fixtures/jekyll_version_3/assets/ring.png",
|
80
|
+
"spec/fixtures/jekyll_version_3/authors.html",
|
81
|
+
"spec/fixtures/jekyll_version_3/excluded.html",
|
82
|
+
"spec/fixtures/jekyll_version_3/hierarchy.md",
|
83
|
+
"spec/fixtures/jekyll_version_3/index.html",
|
84
|
+
"spec/fixtures/jekyll_version_3/page2/index.html",
|
85
|
+
"spec/fixtures/jekyll_version_3/weight.md",
|
72
86
|
"spec/push_spec.rb",
|
73
87
|
"spec/record_extractor_spec.rb",
|
74
88
|
"spec/spec_helper.rb",
|
75
|
-
"spec/spec_helper_jekyll.rb",
|
76
89
|
"spec/spec_helper_simplecov.rb",
|
77
90
|
"txt/api_key_missing",
|
78
91
|
"txt/application_id_missing",
|
@@ -88,6 +101,7 @@ Gem::Specification.new do |s|
|
|
88
101
|
|
89
102
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
90
103
|
s.add_runtime_dependency(%q<algoliasearch>, ["~> 1.4"])
|
104
|
+
s.add_runtime_dependency(%q<appraisal>, ["~> 2.1.0"])
|
91
105
|
s.add_runtime_dependency(%q<awesome_print>, ["~> 1.6"])
|
92
106
|
s.add_runtime_dependency(%q<json>, ["~> 1.8"])
|
93
107
|
s.add_runtime_dependency(%q<nokogiri>, ["~> 1.6"])
|
@@ -95,13 +109,13 @@ Gem::Specification.new do |s|
|
|
95
109
|
s.add_development_dependency(%q<flay>, ["~> 2.6"])
|
96
110
|
s.add_development_dependency(%q<flog>, ["~> 4.3"])
|
97
111
|
s.add_development_dependency(%q<guard-rspec>, ["~> 4.6"])
|
98
|
-
s.add_development_dependency(%q<jekyll>, ["~> 2.5"])
|
99
112
|
s.add_development_dependency(%q<jeweler>, ["~> 2.0"])
|
100
113
|
s.add_development_dependency(%q<rspec>, ["~> 3.0"])
|
101
114
|
s.add_development_dependency(%q<rubocop>, ["~> 0.31"])
|
102
115
|
s.add_development_dependency(%q<simplecov>, ["~> 0.10"])
|
103
116
|
else
|
104
117
|
s.add_dependency(%q<algoliasearch>, ["~> 1.4"])
|
118
|
+
s.add_dependency(%q<appraisal>, ["~> 2.1.0"])
|
105
119
|
s.add_dependency(%q<awesome_print>, ["~> 1.6"])
|
106
120
|
s.add_dependency(%q<json>, ["~> 1.8"])
|
107
121
|
s.add_dependency(%q<nokogiri>, ["~> 1.6"])
|
@@ -109,7 +123,6 @@ Gem::Specification.new do |s|
|
|
109
123
|
s.add_dependency(%q<flay>, ["~> 2.6"])
|
110
124
|
s.add_dependency(%q<flog>, ["~> 4.3"])
|
111
125
|
s.add_dependency(%q<guard-rspec>, ["~> 4.6"])
|
112
|
-
s.add_dependency(%q<jekyll>, ["~> 2.5"])
|
113
126
|
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
114
127
|
s.add_dependency(%q<rspec>, ["~> 3.0"])
|
115
128
|
s.add_dependency(%q<rubocop>, ["~> 0.31"])
|
@@ -117,6 +130,7 @@ Gem::Specification.new do |s|
|
|
117
130
|
end
|
118
131
|
else
|
119
132
|
s.add_dependency(%q<algoliasearch>, ["~> 1.4"])
|
133
|
+
s.add_dependency(%q<appraisal>, ["~> 2.1.0"])
|
120
134
|
s.add_dependency(%q<awesome_print>, ["~> 1.6"])
|
121
135
|
s.add_dependency(%q<json>, ["~> 1.8"])
|
122
136
|
s.add_dependency(%q<nokogiri>, ["~> 1.6"])
|
@@ -124,7 +138,6 @@ Gem::Specification.new do |s|
|
|
124
138
|
s.add_dependency(%q<flay>, ["~> 2.6"])
|
125
139
|
s.add_dependency(%q<flog>, ["~> 4.3"])
|
126
140
|
s.add_dependency(%q<guard-rspec>, ["~> 4.6"])
|
127
|
-
s.add_dependency(%q<jekyll>, ["~> 2.5"])
|
128
141
|
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
129
142
|
s.add_dependency(%q<rspec>, ["~> 3.0"])
|
130
143
|
s.add_dependency(%q<rubocop>, ["~> 0.31"])
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "http://rubygems.org"
|
4
|
+
|
5
|
+
gem "algoliasearch", "~> 1.4"
|
6
|
+
gem "appraisal", "~> 2.1.0"
|
7
|
+
gem "awesome_print", "~> 1.6"
|
8
|
+
gem "json", "~> 1.8"
|
9
|
+
gem "nokogiri", "~> 1.6"
|
10
|
+
gem "jekyll", "~> 2.5"
|
11
|
+
|
12
|
+
group :development do
|
13
|
+
gem "coveralls", "~> 0.8"
|
14
|
+
gem "flay", "~> 2.6"
|
15
|
+
gem "flog", "~> 4.3"
|
16
|
+
gem "guard-rspec", "~> 4.6"
|
17
|
+
gem "jeweler", "~> 2.0"
|
18
|
+
gem "rspec", "~> 3.0"
|
19
|
+
gem "rubocop", "~> 0.31"
|
20
|
+
gem "simplecov", "~> 0.10"
|
21
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "http://rubygems.org"
|
4
|
+
|
5
|
+
gem "algoliasearch", "~> 1.4"
|
6
|
+
gem "appraisal", "~> 2.1.0"
|
7
|
+
gem "awesome_print", "~> 1.6"
|
8
|
+
gem "json", "~> 1.8"
|
9
|
+
gem "nokogiri", "~> 1.6"
|
10
|
+
gem "jekyll", "~> 3.0"
|
11
|
+
gem "jekyll-paginate", "~> 1.1.0"
|
12
|
+
|
13
|
+
group :development do
|
14
|
+
gem "coveralls", "~> 0.8"
|
15
|
+
gem "flay", "~> 2.6"
|
16
|
+
gem "flog", "~> 4.3"
|
17
|
+
gem "guard-rspec", "~> 4.6"
|
18
|
+
gem "jeweler", "~> 2.0"
|
19
|
+
gem "rspec", "~> 3.0"
|
20
|
+
gem "rubocop", "~> 0.31"
|
21
|
+
gem "simplecov", "~> 0.10"
|
22
|
+
end
|
data/lib/record_extractor.rb
CHANGED
@@ -4,6 +4,8 @@ require 'json'
|
|
4
4
|
|
5
5
|
# Given an HTML file as input, will return an array of records to index
|
6
6
|
class AlgoliaSearchRecordExtractor
|
7
|
+
attr_reader :file
|
8
|
+
|
7
9
|
def initialize(file)
|
8
10
|
@file = file
|
9
11
|
@config = file.site.config
|
@@ -31,26 +33,42 @@ class AlgoliaSearchRecordExtractor
|
|
31
33
|
metadata[:type] = @file.class.name.split('::')[1].downcase
|
32
34
|
metadata[:url] = @file.url
|
33
35
|
|
34
|
-
|
35
|
-
metadata[:slug] = @file.slug
|
36
|
-
else
|
37
|
-
basename = File.basename(@file.path)
|
38
|
-
extname = File.extname(basename)
|
39
|
-
metadata[:slug] = File.basename(basename, extname)
|
40
|
-
end
|
36
|
+
metadata[:slug] = slug
|
41
37
|
|
42
38
|
metadata[:posted_at] = @file.date.to_time.to_i if @file.respond_to? :date
|
43
|
-
metadata[:tags] = tags
|
39
|
+
metadata[:tags] = tags
|
44
40
|
|
45
41
|
metadata
|
46
42
|
end
|
47
43
|
|
44
|
+
# Returns the slug of the document
|
45
|
+
def slug
|
46
|
+
# Jekyll v3 has it in data
|
47
|
+
return @file.data['slug'] if @file.data.key?('slug')
|
48
|
+
# Old Jekyll v2 has it at the root
|
49
|
+
return @file.slug if @file.respond_to? :slug
|
50
|
+
# Otherwise, we guess it from the filename
|
51
|
+
basename = File.basename(@file.path)
|
52
|
+
extname = File.extname(basename)
|
53
|
+
File.basename(basename, extname)
|
54
|
+
end
|
55
|
+
|
48
56
|
# Extract a list of tags
|
49
57
|
def tags
|
50
|
-
|
51
|
-
|
52
|
-
#
|
53
|
-
@file.
|
58
|
+
tags = nil
|
59
|
+
|
60
|
+
# Jekyll v3 has it in data, while v2 have it at the root
|
61
|
+
if @file.data.key?('tags')
|
62
|
+
tags = @file.data['tags']
|
63
|
+
elsif @file.respond_to? :tags
|
64
|
+
tags = @file.tags
|
65
|
+
end
|
66
|
+
|
67
|
+
return tags if tags.nil?
|
68
|
+
|
69
|
+
# Anyway, we force cast it to string as some plugins will extend the tags to
|
70
|
+
# full featured objects
|
71
|
+
tags.map(&:to_s)
|
54
72
|
end
|
55
73
|
|
56
74
|
# Get the list of all HTML nodes to index
|
data/lib/version.rb
CHANGED
data/scripts/git_hooks/pre-push
CHANGED
data/scripts/test
ADDED
data/scripts/test_ci
ADDED
data/scripts/test_v2
ADDED
data/scripts/test_v3
ADDED
data/scripts/watch
ADDED