sutty-archives 2.2.3 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll-archives.rb +1 -0
- data/lib/jekyll-archives/archive.rb +23 -0
- data/lib/jekyll-archives/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: 3fef8ed446f2c81a26428e355f7b4c14923fdd56b9367db006f13464f909cac8
|
4
|
+
data.tar.gz: a2a0af5d85a97a779b0ca73f2300612ea333d2c2d99accd12bdc822673ba0874
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4933c5145a31350e62411b303ecba29f8b49a50e63baf4412ef02f6bb96f65cc82ac31febf86c459303ead1d1c7ccdcf1ce2586d323b03c53d26c7be2cdc42ab
|
7
|
+
data.tar.gz: 811cf946c59dbd7c297cfe201843f76f87e043a2d964434ae4e380dbb190eec710ee040526ef270d584aafb4df6a1956dd1d392593831d67f5c9a8957f4f1856
|
data/lib/jekyll-archives.rb
CHANGED
@@ -43,6 +43,17 @@ module Jekyll
|
|
43
43
|
@data = { "layout" => layout }
|
44
44
|
|
45
45
|
@content = ""
|
46
|
+
|
47
|
+
# Replace the value with the archive except for date and
|
48
|
+
# category-tag. For category-tag, do we want to replace the
|
49
|
+
# category or the tag?
|
50
|
+
return unless replace?
|
51
|
+
@posts.each do |post|
|
52
|
+
case post.data[attribute]
|
53
|
+
when Array then post.data[attribute].map!{|v| (v == title) ? self : v }
|
54
|
+
else post.data[attribute] = self
|
55
|
+
end
|
56
|
+
end
|
46
57
|
end
|
47
58
|
|
48
59
|
# The template of the permalink.
|
@@ -151,6 +162,18 @@ module Jekyll
|
|
151
162
|
|
152
163
|
private
|
153
164
|
|
165
|
+
def replace?
|
166
|
+
@config['replace'] && !(date? || @type == 'category-tag')
|
167
|
+
end
|
168
|
+
|
169
|
+
def attribute
|
170
|
+
case type
|
171
|
+
when 'tag' then 'tags'
|
172
|
+
when 'category' then 'categories'
|
173
|
+
else type
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
154
177
|
# Generate slug if @title attribute is a string.
|
155
178
|
#
|
156
179
|
# Note: mode other than those expected by Jekyll returns the given string after
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sutty-archives
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alfred Xing
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-09-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jekyll
|
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
requirements: []
|
147
|
-
rubygems_version: 3.
|
147
|
+
rubygems_version: 3.1.2
|
148
148
|
signing_key:
|
149
149
|
specification_version: 4
|
150
150
|
summary: Post archives for Jekyll. Fork of jekyll-archives.
|