forked from memfault/interrupt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthors.rb
More file actions
26 lines (23 loc) · 677 Bytes
/
Copy pathauthors.rb
File metadata and controls
26 lines (23 loc) · 677 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
module Jekyll
class AuthorPageGenerator < Generator
safe true
def generate(site)
site.data['authors'].each do |author_key, author|
site.pages << AuthorPage.new(site, site.source, author_key, author)
end
end
end
class AuthorPage < Page
def initialize(site, base, author_key, author)
@site = site
@base = base
@dir = File.join('authors', author_key)
@name = 'index.html'
self.process(@name)
self.read_yaml(File.join(base, '_layouts'), 'author.html')
self.data['author'] = author
self.data['author_key'] = author_key
self.data['title'] = "Author: #{author_key}"
end
end
end