Class: Jekyll::Authors
- Inherits:
-
Object
- Object
- Jekyll::Authors
- Defined in:
- lib/jekyll/jekyll-author.rb
Class Method Summary collapse
- .attach_author(post) ⇒ Object
- .authors?(site) ⇒ Boolean
- .default_author(site) ⇒ Object
- .default_author?(site) ⇒ Boolean
- .merge_authors(site) ⇒ Object
- .post_author?(post) ⇒ Boolean
Class Method Details
.attach_author(post) ⇒ Object
24 25 26 |
# File 'lib/jekyll/jekyll-author.rb', line 24 def (post) post.data['author'] = post.site.config['authors'][post.] end |
.authors?(site) ⇒ Boolean
4 5 6 |
# File 'lib/jekyll/jekyll-author.rb', line 4 def (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 (site) site.config['author'] = site.config['authors'].values[0] end |
.default_author?(site) ⇒ Boolean
12 13 14 |
# File 'lib/jekyll/jekyll-author.rb', line 12 def (site) site.config.key?('author') end |
.merge_authors(site) ⇒ Object
8 9 10 |
# File 'lib/jekyll/jekyll-author.rb', line 8 def (site) site.config['authors'].merge!(site.data['authors']) { |_key, v1, _v2| v1 } end |
.post_author?(post) ⇒ Boolean
20 21 22 |
# File 'lib/jekyll/jekyll-author.rb', line 20 def (post) (post..is_a?(String) && post.site.config['authors'].key?(post.)) end |