jekyll-theme-amethyst 2.3.1 → 2.3.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jekyll-theme-amethyst.rb +32 -31
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 853fa0737369c870d6f9942dac2fb26ca3fc594375457082df91d63d68f70899
4
- data.tar.gz: ee3816401577f0cb9bf953ccaab79497b39d0c41c45817b8c4a3b6b63f1523e0
3
+ metadata.gz: f9183ef83dbf1137a9bde691ba1ef2de927b5d462d72f497c16953d69f6a60a8
4
+ data.tar.gz: c34a3002b361467e1da307fb20277691c53a4d8d455c7e8d956de1aca6ab82be
5
5
  SHA512:
6
- metadata.gz: 656a5f472ae652eff62295c5d8c661bce2e64fcd39d5be24905c89e8e723215bd099df7bce6052698efcf2f851880fa6349e8ab61d579d4bd0610f60142180a0
7
- data.tar.gz: 16c91295222c9f6f49d8a7661bf68bce0c1aca47e14723baa6cae78383d8e2a2d2d4730e08b2c04d27515efc9bbcf25391fa1a84d4e678d2cbd2a76c0215010e
6
+ metadata.gz: d77f6bfa7efb0ccec5e268b972232b5c994400384afee1f7ee5a9718f3643693d77b40200959afdca5cc698b9f0d41efc9c7aa06d338a2eb8b77da0f89f1b81a
7
+ data.tar.gz: d7fce1b18a930b8805378210c5856618443b99fdff886852c9ab01efbf5c8aefc85196842c85a4e442a74fd64907adbad2dc4f2f54bc7ab0fb37238e4c1a7f8e
@@ -39,46 +39,47 @@ end
39
39
 
40
40
  Liquid::Template.register_filter(Jekyll::AmethystFilters)
41
41
 
42
- module AmethystPlugin
42
+ module Jekyll
43
+ module AmethystPlugin
44
+ class AuthorPageWithoutAFile < Jekyll::PageWithoutAFile
45
+ def template
46
+ # The permalink template, e.g. customize to "/blog/author/:author/"
47
+ # on sites with both API docs and a blog.
48
+ author_permalink = site.config["amethyst"]["author_permalink"] || "/author/:author"
49
+ Utils.add_permalink_suffix(author_permalink, site.permalink_style)
50
+ end
43
51
 
44
- class AuthorPageWithoutAFile < Jekyll::PageWithoutAFile
45
- def template
46
- # The template of the permalink, can be customized e.g. to "/blog/author/:author/"
47
- # for sites with both API docs and a blog.
48
- site.config["amethyst"]["author_permalink"] || "/author/:author"
52
+ def url_placeholders
53
+ super.merge({
54
+ "author" => data["author"]
55
+ })
56
+ end
49
57
  end
50
58
 
51
- def url_placeholders
52
- super.merge({
53
- "author" => data["author"]
54
- })
55
- end
56
- end
59
+ class AuthorPageGenerator < Jekyll::Generator
60
+ safe true
57
61
 
58
- class AuthorPageGenerator < Jekyll::Generator
59
- safe true
60
-
61
- def generate(site)
62
- site.data["authors"]&.each do |slug, name|
63
- site.pages << AuthorPageWithoutAFile.new(site, site.source, 'author', "#{slug}.html").tap do |page|
64
- page.data.merge!(
65
- "layout" => "posts-author",
66
- "title" => name,
67
- "author" => slug
68
- )
62
+ def generate(site)
63
+ site.data["authors"]&.each do |slug, name|
64
+ site.pages << AuthorPageWithoutAFile.new(site, site.source, 'author', "#{slug}.html").tap do |page|
65
+ page.data.merge!(
66
+ "layout" => "posts-author",
67
+ "title" => name,
68
+ "author" => slug
69
+ )
70
+ end
69
71
  end
70
72
  end
71
73
  end
72
- end
73
74
 
74
- class YearDataGenerator < Jekyll::Generator
75
- safe true
75
+ class YearDataGenerator < Jekyll::Generator
76
+ safe true
76
77
 
77
- def generate(site)
78
- s = Set.new()
79
- site.posts&.docs&.each { |post| s.add(post.date.strftime('%Y')) }
80
- site.data["amethyst_post_years"] = s.to_a.sort!.reverse!
78
+ def generate(site)
79
+ s = Set.new()
80
+ site.posts&.docs&.each { |post| s.add(post.date.strftime('%Y')) }
81
+ site.data["amethyst_post_years"] = s.to_a.sort!.reverse!
82
+ end
81
83
  end
82
84
  end
83
-
84
85
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-amethyst
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Tijhof