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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 504d81958bc2f61213d04212cd3988a17131869a0dff5e294f0782e353515f43
4
- data.tar.gz: cb58a0438cdd6bbf51c33ac2bea2f33e5862498039d81d74c9bb56d94fe48c44
3
+ metadata.gz: eb321000de02f19e06eeeb4c87cb3e631a5e587a8eaa1c8f8b1d1ca5f122035d
4
+ data.tar.gz: 7c246d8580ac25397faf9408c70baebc7297deee7ad4c4e678d8c0e7de0012a5
5
5
  SHA512:
6
- metadata.gz: b25f4cc57b9b894980af8c95a65d3e6c35b5ef68de2c91c983d11a7c53300f96116592f20a364e7aae34c71aa028ac98ebcbe421324a9b43b2f5cbf851889f26
7
- data.tar.gz: 4259f6adafecb055f17404b46b1ba0a2033bc68905a174bca902dfdd09151ab9eb5f293d35ad37ae190e04de6c740b71107389a43734ac31c30180d64acc6a8b
6
+ metadata.gz: c0aa4305061361e3aee1ed18a230f09f0dbea26458fbb97f98c72399afe29d4180e7ad51b688716824ae6f820464f49e34eb9d1810a5023a228840e611fed87d
7
+ data.tar.gz: 8d2a98375dcb61f3af31fe0c6168366fa5525311f10ab07f6ec3926feb652c48a3750940d9b6c8937cf83add40145a0e97298fbb115264a834b927995fe8530b
@@ -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
- "layout" => layout,
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Archives
5
- VERSION = "2.2.2"
5
+ VERSION = "2.2.3"
6
6
  end
7
7
  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.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-07-21 00:00:00.000000000 Z
12
+ date: 2020-08-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jekyll