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.
- checksums.yaml +4 -4
- data/lib/jekyll-theme-amethyst.rb +32 -31
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9183ef83dbf1137a9bde691ba1ef2de927b5d462d72f497c16953d69f6a60a8
|
4
|
+
data.tar.gz: c34a3002b361467e1da307fb20277691c53a4d8d455c7e8d956de1aca6ab82be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
52
|
+
def url_placeholders
|
53
|
+
super.merge({
|
54
|
+
"author" => data["author"]
|
55
|
+
})
|
56
|
+
end
|
49
57
|
end
|
50
58
|
|
51
|
-
|
52
|
-
|
53
|
-
"author" => data["author"]
|
54
|
-
})
|
55
|
-
end
|
56
|
-
end
|
59
|
+
class AuthorPageGenerator < Jekyll::Generator
|
60
|
+
safe true
|
57
61
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
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
|
-
|
75
|
-
|
75
|
+
class YearDataGenerator < Jekyll::Generator
|
76
|
+
safe true
|
76
77
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
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
|