jekyll_all_collections 0.3.4 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +14 -5
- data/CHANGELOG.md +12 -0
- data/README.md +18 -1
- data/jekyll_all_collections.gemspec +2 -2
- data/lib/all_collections_hooks.rb +5 -3
- data/lib/all_collections_tag.rb +1 -1
- data/lib/jekyll_all_collections/version.rb +1 -1
- data/spec/status_persistence.txt +22 -23
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1a935e77649731f0ecea36559559fe45c937b004d019fbf777ad74621b252af
|
4
|
+
data.tar.gz: 24be6a67384819242fd22901d9d4a7cf1a7cbc5bc88fbaea7ed9c53fa357ad33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0266898e0d13bb95adcc909ed92a7d916741b847ff61bcd9ffe8ac07b370e376545a9120a91d1ad34347fe95084f634850fa7f853e13bc0a4ffa59491d94b4a7'
|
7
|
+
data.tar.gz: 02f706416a7c7578ab2819321b6698b3980e7c00c88002b313f587f33c9bdda8bdb9bd7f96f06d13d4636f2394b7a2bfc2b009db874df7d0c1e04f95ebf4cd43
|
data/.rubocop.yml
CHANGED
@@ -30,18 +30,18 @@ Layout/LineLength:
|
|
30
30
|
Max: 150
|
31
31
|
|
32
32
|
Metrics/AbcSize:
|
33
|
-
Max:
|
33
|
+
Max: 55
|
34
34
|
|
35
35
|
Metrics/BlockLength:
|
36
36
|
Exclude:
|
37
|
-
-
|
37
|
+
- jekyll_plugin_support.gemspec
|
38
38
|
Max: 30
|
39
39
|
|
40
40
|
Metrics/CyclomaticComplexity:
|
41
41
|
Max: 25
|
42
42
|
|
43
43
|
Metrics/MethodLength:
|
44
|
-
Max:
|
44
|
+
Max: 50
|
45
45
|
|
46
46
|
Metrics/PerceivedComplexity:
|
47
47
|
Max: 25
|
@@ -49,14 +49,17 @@ Metrics/PerceivedComplexity:
|
|
49
49
|
Naming/FileName:
|
50
50
|
Exclude:
|
51
51
|
- Rakefile
|
52
|
+
- "*.md"
|
52
53
|
|
53
54
|
RSpec/ExampleLength:
|
54
55
|
Max: 30
|
55
56
|
|
56
|
-
RSpec/
|
57
|
+
RSpec/SpecFilePathFormat:
|
57
58
|
Enabled: false
|
58
59
|
IgnoreMethods: true
|
59
|
-
|
60
|
+
|
61
|
+
RSpec/SpecFilePathSuffix:
|
62
|
+
Enabled: false
|
60
63
|
|
61
64
|
RSpec/IndexedLet:
|
62
65
|
Enabled: false
|
@@ -64,11 +67,17 @@ RSpec/IndexedLet:
|
|
64
67
|
RSpec/MultipleExpectations:
|
65
68
|
Max: 15
|
66
69
|
|
70
|
+
Style/ClassVars:
|
71
|
+
Enabled: false
|
72
|
+
|
67
73
|
Style/Documentation:
|
68
74
|
Enabled: false
|
69
75
|
|
70
76
|
Style/FrozenStringLiteralComment:
|
71
77
|
Enabled: false
|
72
78
|
|
79
|
+
Style/StringConcatenation:
|
80
|
+
Enabled: false
|
81
|
+
|
73
82
|
Style/TrailingCommaInHashLiteral:
|
74
83
|
EnforcedStyleForMultiline: comma
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.3.6 / 2024-07-23
|
4
|
+
|
5
|
+
* Made compatible with module renaming in JekyllPluginSupport v1.0.0
|
6
|
+
|
7
|
+
|
8
|
+
## 0.3.5 / 2024-03-26
|
9
|
+
|
10
|
+
* Added `APage.extname` for compatibility with Jekyll
|
11
|
+
[`Document`](https://github.com/jekyll/jekyll/blob/master/lib/jekyll/document.rb);
|
12
|
+
previously, the filetype of the uri was provided only as `APage.ext`.
|
13
|
+
|
14
|
+
|
3
15
|
## 0.3.4 / 2023-12-24
|
4
16
|
|
5
17
|
* Changed dependency to Jekyll >= 4.3.2
|
data/README.md
CHANGED
@@ -72,6 +72,23 @@ No explicit initialization or setup is required.
|
|
72
72
|
Jekyll plugins can access the value of `site.all_collections`, however Liquid code in Jekyll pages and documents cannot.
|
73
73
|
|
74
74
|
|
75
|
+
### Plugin Usage
|
76
|
+
|
77
|
+
Jekyll generators and tags receive an enhanced version of the `site` Jekyll variable.
|
78
|
+
A new array of `APage` instance called `all_collections` is added, one for each Jekyll document and page.
|
79
|
+
Examine [`APage.rb`](https://github.com/mslinn/jekyll_all_collections/blob/v0.3.4/lib/all_collections_hooks.rb#L68-L102)
|
80
|
+
to see the available properties.
|
81
|
+
One particularly useful property is `url`, which is difficult to obtain from Jekyll.
|
82
|
+
|
83
|
+
All `Jekyll::Page`s and `Jekyll:Document`s can be processed with the following sample code:
|
84
|
+
|
85
|
+
```ruby
|
86
|
+
(@site.all_collections + @site.pages).each do |page_or_apage|
|
87
|
+
do_something_with page_or_apage
|
88
|
+
end
|
89
|
+
```
|
90
|
+
|
91
|
+
|
75
92
|
### `All_collections` Tag
|
76
93
|
|
77
94
|
Add the following CSS to your stylesheet:
|
@@ -194,7 +211,7 @@ and the tertiary key as `label`:
|
|
194
211
|
```
|
195
212
|
|
196
213
|
|
197
|
-
#### Usage Examples
|
214
|
+
#### Liquid Usage Examples
|
198
215
|
|
199
216
|
Here is a short Jekyll page, including front matter,
|
200
217
|
demonstrating this plugin being invoked with all default attribute values:
|
@@ -30,6 +30,6 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.version = JekyllAllCollectionsVersion::VERSION
|
31
31
|
|
32
32
|
spec.add_dependency 'jekyll', '>= 3.5.0'
|
33
|
-
spec.add_dependency 'jekyll_draft'
|
34
|
-
spec.add_dependency 'jekyll_plugin_support'
|
33
|
+
spec.add_dependency 'jekyll_draft'
|
34
|
+
spec.add_dependency 'jekyll_plugin_support'
|
35
35
|
end
|
@@ -12,7 +12,7 @@ module AllCollectionsHooks
|
|
12
12
|
# @logger.debug { "Jekyll::Hooks.register(:site, :after_init: #{defined}" }
|
13
13
|
# end
|
14
14
|
|
15
|
-
# Creates a `Array[
|
15
|
+
# Creates a `Array[APage]` property called site.all_collections if it does not already exist
|
16
16
|
# Each `APage` entry is one document or page.
|
17
17
|
Jekyll::Hooks.register(:site, :post_read, priority: :normal) do |site|
|
18
18
|
defined = AllCollectionsHooks.all_collections_defined?(site)
|
@@ -66,7 +66,7 @@ module AllCollectionsHooks
|
|
66
66
|
end
|
67
67
|
|
68
68
|
class APage
|
69
|
-
attr_reader :content, :data, :date, :description, :destination, :draft, :excerpt, :ext,
|
69
|
+
attr_reader :content, :data, :date, :description, :destination, :draft, :excerpt, :ext, :extname,
|
70
70
|
:label, :last_modified, :layout, :path, :relative_path, :tags, :title, :type, :url
|
71
71
|
|
72
72
|
# Verify each property exists before accessing it; this helps write tests
|
@@ -83,7 +83,9 @@ module AllCollectionsHooks
|
|
83
83
|
|
84
84
|
@draft = Jekyll::Draft.draft?(obj)
|
85
85
|
@excerpt = @data['excerpt'] if @data.key? 'excerpt'
|
86
|
-
@ext =
|
86
|
+
@ext = obj.extname
|
87
|
+
@ext ||= @data['ext'] if @data.key? 'ext'
|
88
|
+
@extname = @ext # For compatibility with previous versions of all_collections
|
87
89
|
@label = obj.collection.label if obj&.collection.respond_to? :label
|
88
90
|
@last_modified = @data['last_modified'] || @data['last_modified_at'] || @date
|
89
91
|
@last_modified_field = case @data
|
data/lib/all_collections_tag.rb
CHANGED
data/spec/status_persistence.txt
CHANGED
@@ -1,23 +1,22 @@
|
|
1
|
-
example_id
|
2
|
-
|
3
|
-
./spec/
|
4
|
-
./spec/
|
5
|
-
./spec/
|
6
|
-
./spec/
|
7
|
-
./spec/
|
8
|
-
./spec/
|
9
|
-
./spec/
|
10
|
-
./spec/
|
11
|
-
./spec/
|
12
|
-
./spec/
|
13
|
-
./spec/
|
14
|
-
./spec/
|
15
|
-
./spec/
|
16
|
-
./spec/
|
17
|
-
./spec/
|
18
|
-
./spec/
|
19
|
-
./spec/
|
20
|
-
./spec/
|
21
|
-
./spec/
|
22
|
-
./spec/
|
23
|
-
./spec/lambda_sort_spec.rb[1:11] | passed | 0.00036 seconds |
|
1
|
+
example_id | status | run_time |
|
2
|
+
----------------------------------------------------------------- | ------ | --------------- |
|
3
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:1] | passed | 0.00138 seconds |
|
4
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:2] | passed | 0.00185 seconds |
|
5
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:3] | passed | 0.0016 seconds |
|
6
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:4] | passed | 0.00169 seconds |
|
7
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:5] | passed | 0.0012 seconds |
|
8
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:6] | passed | 0.00154 seconds |
|
9
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:7] | passed | 0.00122 seconds |
|
10
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:8] | passed | 0.0015 seconds |
|
11
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:9] | passed | 0.00141 seconds |
|
12
|
+
./spec/all_collections_tag/all_collections_tag_sort_spec.rb[1:10] | passed | 0.00118 seconds |
|
13
|
+
./spec/date_sort_spec.rb[1:1] | passed | 0.00007 seconds |
|
14
|
+
./spec/date_sort_spec.rb[1:2] | passed | 0.00005 seconds |
|
15
|
+
./spec/date_sort_spec.rb[1:3] | passed | 0.00005 seconds |
|
16
|
+
./spec/date_sort_spec.rb[1:4] | passed | 0.00005 seconds |
|
17
|
+
./spec/date_sort_spec.rb[1:5] | passed | 0.00011 seconds |
|
18
|
+
./spec/date_sort_spec.rb[1:6] | passed | 0.00004 seconds |
|
19
|
+
./spec/date_sort_spec.rb[1:7] | passed | 0.00006 seconds |
|
20
|
+
./spec/date_sort_spec.rb[1:8] | passed | 0.00004 seconds |
|
21
|
+
./spec/date_sort_spec.rb[1:9] | passed | 0.00004 seconds |
|
22
|
+
./spec/date_sort_spec.rb[1:10] | passed | 0.00005 seconds |
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll_all_collections
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Slinn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -30,28 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: jekyll_plugin_support
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0
|
47
|
+
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0
|
54
|
+
version: '0'
|
55
55
|
description: 'Provides a collection of all collections in site.all_collections.
|
56
56
|
|
57
57
|
'
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
|
-
rubygems_version: 3.
|
102
|
+
rubygems_version: 3.5.16
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: Provides a collection of all collections in site.all_collections.
|