sutty-archives 2.2.2 → 2.2.3
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 +3 -2
- data/lib/jekyll-archives/archive.rb +4 -5
- data/lib/jekyll-archives/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb321000de02f19e06eeeb4c87cb3e631a5e587a8eaa1c8f8b1d1ca5f122035d
|
4
|
+
data.tar.gz: 7c246d8580ac25397faf9408c70baebc7297deee7ad4c4e678d8c0e7de0012a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0aa4305061361e3aee1ed18a230f09f0dbea26458fbb97f98c72399afe29d4180e7ad51b688716824ae6f820464f49e34eb9d1810a5023a228840e611fed87d
|
7
|
+
data.tar.gz: 8d2a98375dcb61f3af31fe0c6168366fa5525311f10ab07f6ec3926feb652c48a3750940d9b6c8937cf83add40145a0e97298fbb115264a834b927995fe8530b
|
data/lib/jekyll-archives.rb
CHANGED
@@ -19,14 +19,15 @@ module Jekyll
|
|
19
19
|
DEFAULTS = {
|
20
20
|
"layout" => "archive",
|
21
21
|
"enabled" => [],
|
22
|
+
"titles" => {},
|
22
23
|
"permalinks" => {
|
23
24
|
"year" => "/:year/",
|
24
25
|
"month" => "/:year/:month/",
|
25
26
|
"day" => "/:year/:month/:day/",
|
26
27
|
"tag" => "/tag/:name/",
|
27
28
|
"category" => "/category/:name/",
|
28
|
-
"category-tag" => "/category/:category/tag/:tag/"
|
29
|
-
}
|
29
|
+
"category-tag" => "/category/:category/tag/:tag/",
|
30
|
+
}
|
30
31
|
}.freeze
|
31
32
|
|
32
33
|
def initialize(config = {})
|
@@ -40,9 +40,8 @@ module Jekyll
|
|
40
40
|
@path = relative_path
|
41
41
|
@name = File.basename(relative_path, @ext)
|
42
42
|
|
43
|
-
@data = {
|
44
|
-
|
45
|
-
}
|
43
|
+
@data = { "layout" => layout }
|
44
|
+
|
46
45
|
@content = ""
|
47
46
|
end
|
48
47
|
|
@@ -51,7 +50,7 @@ module Jekyll
|
|
51
50
|
# Returns the template String.
|
52
51
|
def template
|
53
52
|
t = @config.dig("permalinks", type)
|
54
|
-
t = t.is_a?(Hash) ? t[title] : t
|
53
|
+
t = t.is_a?(Hash) ? t[@title] : t
|
55
54
|
|
56
55
|
t || "/#{type}/:name/"
|
57
56
|
end
|
@@ -104,7 +103,7 @@ module Jekyll
|
|
104
103
|
# date-based archives.
|
105
104
|
def title
|
106
105
|
if @title.is_a? String
|
107
|
-
@title
|
106
|
+
@config.dig('titles', @title) || @title
|
108
107
|
elsif @type == 'category-tag'
|
109
108
|
@title.values.join(@config.fetch('separator', ' / '))
|
110
109
|
end
|
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.2.
|
4
|
+
version: 2.2.3
|
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-08-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jekyll
|