Method: Lifer::Entry#authors

Defined in:
lib/lifer/entry.rb

#authorsArray<String>

Given the entry’s frontmatter, we should be able to get a list of authors. We always prefer authors (as opposed to a singular author) because it makes handling both cases easier in the long run.

The return value here is likely an author’s name. Whether that’s a full name, a first name, or a handle is up to the end user.

Returns:

  • (Array<String>)

    An array of authors’s names.



135
136
137
# File 'lib/lifer/entry.rb', line 135

def authors
  Array(frontmatter[:author] || frontmatter[:authors]).compact
end