jekyll-auto-authors 1.0.1 → 1.0.2
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 +4 -4
- data/lib/jekyll-auto-authors/main.rb +28 -3
- data/lib/jekyll-auto-authors/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f56777050861e92409c8e41d0fadb6ff434f9e80d8deb2888feb825346670d2
|
4
|
+
data.tar.gz: 21308acb7d5c41abdd512cc5f13aed227a82d8316d97479b28c9bac5caad62a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c77c506c66f77397c92668ef8b0d826d08c3030a1fbd4b4f950f54ac3ea9597cc4f53e33ed39271ee4b0d749f0d106ecc4ec9fbd788d7f5e39acc107b57f5f0c
|
7
|
+
data.tar.gz: d1549730b64e526b3b1a099981176b3bb414aed88d412c9e58bd4931ad9197a8b484430309163d9cfb9b5c59faefc4e2d6ab6724cf06e2973addefbd638ddd3f
|
@@ -26,8 +26,6 @@ module Jekyll
|
|
26
26
|
return
|
27
27
|
end
|
28
28
|
|
29
|
-
Jekyll.logger.info "Author Pages:", "Generating..."
|
30
|
-
|
31
29
|
# Lambda that created the author page for a given author.
|
32
30
|
# will be passed to PaginateV2::Autopages for processing.
|
33
31
|
createauthorpage_lambda = lambda do | autopage_author_config, pagination_config, layout_name, author, author_original_name |
|
@@ -59,6 +57,31 @@ module Jekyll
|
|
59
57
|
autopage_config, pagination_config, posts_to_use, "authors", "author", createauthorpage_lambda
|
60
58
|
)
|
61
59
|
|
60
|
+
# Set of authors for whom autopages have been created
|
61
|
+
finished_pages = Set.new
|
62
|
+
|
63
|
+
posts_to_use.each do | post |
|
64
|
+
next if post.data["author"].nil? || finished_pages.include?(post.data["author"])
|
65
|
+
finished_pages << post.data["author"]
|
66
|
+
end
|
67
|
+
|
68
|
+
if !authors_config["data"].nil?
|
69
|
+
# if a data file containing authors is not nil, then iterate through the specified
|
70
|
+
# authors to build author pages for them, even if they don't have posts yet.
|
71
|
+
author_data = YAML::load(File.read(authors_config["data"]))
|
72
|
+
|
73
|
+
author_data.each do | author, data |
|
74
|
+
if !finished_pages.include?(author)
|
75
|
+
# create pages for pending authors with specified layouts
|
76
|
+
authors_config['layouts'].each do | layout_name |
|
77
|
+
createauthorpage_lambda.call(authors_config, pagination_config, layout_name, author, author)
|
78
|
+
end
|
79
|
+
|
80
|
+
finished_pages << author
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
62
85
|
# Now auto pages for authors have been created, we can generate the pagination logic.
|
63
86
|
|
64
87
|
# Further logic is mostly similar as PaginateV2::Generator::PaginationModel#paginate(), but we need
|
@@ -133,7 +156,8 @@ module Jekyll
|
|
133
156
|
|
134
157
|
pagination_posts.sort!{ |a,b|
|
135
158
|
PaginateV2::Generator::Utils.sort_values(
|
136
|
-
PaginateV2::Generator::Utils.sort_get_post_data(a.data, sort_field),
|
159
|
+
PaginateV2::Generator::Utils.sort_get_post_data(a.data, sort_field),
|
160
|
+
PaginateV2::Generator::Utils.sort_get_post_data(b.data, sort_field)
|
137
161
|
)
|
138
162
|
}
|
139
163
|
|
@@ -256,6 +280,7 @@ module Jekyll
|
|
256
280
|
end
|
257
281
|
end
|
258
282
|
|
283
|
+
Jekyll.logger.info "Author Pages:", "Generated autopages for #{finished_pages.size} author(s)"
|
259
284
|
end
|
260
285
|
end
|
261
286
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-auto-authors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gourav Khunger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
requirements: []
|
91
|
-
rubygems_version: 3.3.
|
91
|
+
rubygems_version: 3.3.11
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: Seamless multiple authors support for jekyll powered publications
|