Class: Jekyll::Authors

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/jekyll-author.rb

Class Method Summary collapse

Class Method Details

.attach_author(post) ⇒ Object



24
25
26
# File 'lib/jekyll/jekyll-author.rb', line 24

def attach_author(post)
  post.data['author'] = post.site.config['authors'][post.author]
end

.authors?(site) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/jekyll/jekyll-author.rb', line 4

def authors?(site)
  (site.data.key?('authors') || site.config.key?('authors'))
end

.default_author(site) ⇒ Object



16
17
18
# File 'lib/jekyll/jekyll-author.rb', line 16

def default_author(site)
  site.config['author'] = site.config['authors'].values[0]
end

.default_author?(site) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/jekyll/jekyll-author.rb', line 12

def default_author?(site)
  site.config.key?('author')
end

.merge_authors(site) ⇒ Object



8
9
10
# File 'lib/jekyll/jekyll-author.rb', line 8

def merge_authors(site)
  site.config['authors'].merge!(site.data['authors']) { |_key, v1, _v2| v1 }
end

.post_author?(post) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/jekyll/jekyll-author.rb', line 20

def (post)
  (post.author.is_a?(String) && post.site.config['authors'].key?(post.author))
end