sutty-archives 2.2.1 → 2.2.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-archives.rb +15 -1
- data/lib/jekyll-archives/archive.rb +9 -2
- data/lib/jekyll-archives/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 504d81958bc2f61213d04212cd3988a17131869a0dff5e294f0782e353515f43
|
4
|
+
data.tar.gz: cb58a0438cdd6bbf51c33ac2bea2f33e5862498039d81d74c9bb56d94fe48c44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b25f4cc57b9b894980af8c95a65d3e6c35b5ef68de2c91c983d11a7c53300f96116592f20a364e7aae34c71aa028ac98ebcbe421324a9b43b2f5cbf851889f26
|
7
|
+
data.tar.gz: 4259f6adafecb055f17404b46b1ba0a2033bc68905a174bca902dfdd09151ab9eb5f293d35ad37ae190e04de6c740b71107389a43734ac31c30180d64acc6a8b
|
data/lib/jekyll-archives.rb
CHANGED
@@ -71,14 +71,28 @@ module Jekyll
|
|
71
71
|
post_attr_hash(attr).each do |title, posts|
|
72
72
|
attr = LEGACY_ATTRS[attr] if LEGACY_ATTRS[attr]
|
73
73
|
|
74
|
+
next unless attr_title_enabled? attr, title
|
75
|
+
|
74
76
|
@archives << Archive.new(@site, title, attr, posts)
|
75
77
|
end
|
76
78
|
end
|
77
79
|
end
|
78
80
|
|
81
|
+
# If the permalink is a hash of value => template, check if it
|
82
|
+
# isn't disabled.
|
83
|
+
def attr_title_enabled?(attr, value)
|
84
|
+
permalinks = @config.dig('permalinks', attr)
|
85
|
+
|
86
|
+
if permalinks.is_a?(Hash)
|
87
|
+
!!permalinks.dig(value)
|
88
|
+
else
|
89
|
+
true
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
79
93
|
def read_categories_tags
|
80
94
|
if enabled? "categories-tags"
|
81
|
-
categories.each do |category, posts|
|
95
|
+
@site.categories.each do |category, posts|
|
82
96
|
posts.map { |post| post.data['tags'] }.flatten.uniq.compact.each do |tag|
|
83
97
|
category_tag_posts = posts.select do |post|
|
84
98
|
post.data['categories'].include?(category) &&
|
@@ -50,7 +50,10 @@ module Jekyll
|
|
50
50
|
#
|
51
51
|
# Returns the template String.
|
52
52
|
def template
|
53
|
-
@config.dig("permalinks", type)
|
53
|
+
t = @config.dig("permalinks", type)
|
54
|
+
t = t.is_a?(Hash) ? t[title] : t
|
55
|
+
|
56
|
+
t || "/#{type}/:name/"
|
54
57
|
end
|
55
58
|
|
56
59
|
# The layout to use for rendering
|
@@ -111,7 +114,7 @@ module Jekyll
|
|
111
114
|
#
|
112
115
|
# Returns a Date.
|
113
116
|
def date
|
114
|
-
return unless
|
117
|
+
return unless date?
|
115
118
|
|
116
119
|
@date ||= begin
|
117
120
|
args = @title.values.map(&:to_i)
|
@@ -143,6 +146,10 @@ module Jekyll
|
|
143
146
|
"#<Jekyll:Archive @type=#{@type} @title=#{@title} @data=#{@data.inspect}>"
|
144
147
|
end
|
145
148
|
|
149
|
+
def date?
|
150
|
+
%w[year month day].include? @type
|
151
|
+
end
|
152
|
+
|
146
153
|
private
|
147
154
|
|
148
155
|
# Generate slug if @title attribute is a string.
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sutty-archives
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alfred Xing
|
8
8
|
- f
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-07-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jekyll
|
@@ -116,7 +116,7 @@ dependencies:
|
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
description: Automatically generate post archives by dates, and any front matter attribute.
|
119
|
-
email:
|
119
|
+
email:
|
120
120
|
executables: []
|
121
121
|
extensions: []
|
122
122
|
extra_rdoc_files: []
|
@@ -129,7 +129,7 @@ homepage: https://0xacab.org/sutty/jekyll/sutty-archives
|
|
129
129
|
licenses:
|
130
130
|
- MIT
|
131
131
|
metadata: {}
|
132
|
-
post_install_message:
|
132
|
+
post_install_message:
|
133
133
|
rdoc_options: []
|
134
134
|
require_paths:
|
135
135
|
- lib
|
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
147
|
rubygems_version: 3.0.3
|
148
|
-
signing_key:
|
148
|
+
signing_key:
|
149
149
|
specification_version: 4
|
150
150
|
summary: Post archives for Jekyll. Fork of jekyll-archives.
|
151
151
|
test_files: []
|