jekyll-auto-authors 1.0.2 → 1.0.4

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: 5f56777050861e92409c8e41d0fadb6ff434f9e80d8deb2888feb825346670d2
4
- data.tar.gz: 21308acb7d5c41abdd512cc5f13aed227a82d8316d97479b28c9bac5caad62a4
3
+ metadata.gz: 65d2e6ed40ee995dffb47243d438b9eac97de5030f211828ff69510f9eaac031
4
+ data.tar.gz: 7390218b4f544518c1e4e7533cb86821c6b5a82189b46f12a02c00dd7d2fd192
5
5
  SHA512:
6
- metadata.gz: c77c506c66f77397c92668ef8b0d826d08c3030a1fbd4b4f950f54ac3ea9597cc4f53e33ed39271ee4b0d749f0d106ecc4ec9fbd788d7f5e39acc107b57f5f0c
7
- data.tar.gz: d1549730b64e526b3b1a099981176b3bb414aed88d412c9e58bd4931ad9197a8b484430309163d9cfb9b5c59faefc4e2d6ab6724cf06e2973addefbd638ddd3f
6
+ metadata.gz: 6cff403611021beefa94d0d8fdd8e6d10e0b72087154868ddb215df7faaa1c619fe2b9c95928aae325957f203d12a6efc7c281af412fd9f86a81ed7e636b1c61
7
+ data.tar.gz: 3f0bf9e838648cb663225fd4731e36afb89324771bb2e988bd84bb7eed9d1df02d853dd4d52a6e7dbe28e7a27d2caae1fc26b045c0ef7266343828b3d44c2334
@@ -8,8 +8,10 @@ module Jekyll
8
8
  "data" => "_data/authors.yml", # The data file inside _data/ folder that contains author information.
9
9
  "layouts" => ["authors.html"], # The layout file inside _layouts/ folder to use for the author pages.
10
10
 
11
+ "exclude" => [], # The list of authors to **force** skip processing an autopage for.
12
+
11
13
  "title" => "Posts by :author", # :author is replaced by author name.
12
- "permalink" => "/author/:author", # :author is customizable elements
14
+ "permalink" => "/author/:author", # :author is customizable elements.
13
15
 
14
16
  "slugify" => {
15
17
  "mode" => "none", # [raw, default, pretty, ascii or latin], none gives back the same string.
@@ -12,6 +12,9 @@ module Jekyll
12
12
  autopage_config = Jekyll::Utils.deep_merge_hashes(PaginateV2::AutoPages::DEFAULT, site.config["autopages"] || {})
13
13
  pagination_config = Jekyll::Utils.deep_merge_hashes(PaginateV2::Generator::DEFAULT, site.config["pagination"] || {})
14
14
 
15
+ # Hack for exclude logic to be used later
16
+ autopage_config["authors"]["exclude"] ||= []
17
+
15
18
  # load the configs for jekyll-auto-authors (this plugin).
16
19
  authors_config = Jekyll::Utils.deep_merge_hashes(DEFAULT, site.config["autopages"]["authors"] || {})
17
20
 
@@ -29,6 +32,9 @@ module Jekyll
29
32
  # Lambda that created the author page for a given author.
30
33
  # will be passed to PaginateV2::Autopages for processing.
31
34
  createauthorpage_lambda = lambda do | autopage_author_config, pagination_config, layout_name, author, author_original_name |
35
+ # Force skip excluded authors from autopage generation
36
+ return if autopage_author_config["exclude"].include?(author)
37
+
32
38
  if !autopage_author_config["data"].nil?
33
39
  author_data = YAML::load(File.read(autopage_author_config["data"]))[author_original_name]
34
40
 
@@ -71,7 +77,8 @@ module Jekyll
71
77
  author_data = YAML::load(File.read(authors_config["data"]))
72
78
 
73
79
  author_data.each do | author, data |
74
- if !finished_pages.include?(author)
80
+ # The exclude attribute ignores authors from autopage generation unless they have a post assigned.
81
+ if !finished_pages.include?(author) and !data["exclude"]
75
82
  # create pages for pending authors with specified layouts
76
83
  authors_config['layouts'].each do | layout_name |
77
84
  createauthorpage_lambda.call(authors_config, pagination_config, layout_name, author, author)
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module AutoAuthors
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
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.2
4
+ version: 1.0.4
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-07-15 00:00:00.000000000 Z
11
+ date: 2023-05-11 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.11
91
+ rubygems_version: 3.4.13
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: Seamless multiple authors support for jekyll powered publications