Module: Jekyll::Authors::Utils

Included in:
AuthorFeed, AuthorIndex
Defined in:
lib/jekyll-authors.rb

Instance Method Summary collapse

Instance Method Details

#author_title_prefixString

Returns the ‘author_title_prefix` or “Author: ”

Returns:

  • (String)


25
26
27
# File 'lib/jekyll-authors.rb', line 25

def author_title_prefix
  site.config['author_title_prefix'] || 'Author: '
end

#display_name(author) ⇒ String

Returns the ‘display_name` associated with the author. If there isn’t one, it returns the nickname.

Parameters:

  • author (String)

Returns:

  • (String)


12
13
14
15
16
17
18
19
20
# File 'lib/jekyll-authors.rb', line 12

def display_name(author)
  return unless site.config['authors']

  if site.config['authors'][author]
    site.config['authors'][author]['display_name']
  else
    author
  end
end