Class: Lifer::Builder::HTML::FromLiquid::Drops::EntryDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Lifer::Builder::HTML::FromLiquid::Drops::EntryDrop
- Defined in:
- lib/lifer/builder/html/from_liquid/drops/entry_drop.rb
Overview
This drop represents a Lifer entry and allows users to access entry metadata and content in Liquid templates.
Instance Attribute Summary collapse
-
#collection ⇒ Object
Returns the value of attribute collection.
-
#lifer_entry ⇒ Object
Returns the value of attribute lifer_entry.
Instance Method Summary collapse
-
#author ⇒ String
The entry author (or authors).
-
#authors ⇒ String
The entry authors (or author).
-
#content ⇒ String
The entry content.
-
#frontmatter ⇒ FrontmatterDrop
The entry frontmatter data.
-
#initialize(lifer_entry, collection:, tags:) ⇒ EntryDrop
constructor
A new instance of EntryDrop.
-
#path ⇒ String
The path to the entry.
-
#permalink ⇒ String
The entry permalink.
-
#published_at ⇒ String
The entry publication date (as a string).
-
#summary ⇒ String
The summary of the entry.
-
#title ⇒ String
The entry title.
-
#updated_at ⇒ String
The entry’s last updated date (as a string).
Constructor Details
#initialize(lifer_entry, collection:, tags:) ⇒ EntryDrop
Returns a new instance of EntryDrop.
14 15 16 17 18 |
# File 'lib/lifer/builder/html/from_liquid/drops/entry_drop.rb', line 14 def initialize(lifer_entry, collection:, tags:) @lifer_entry = lifer_entry @collection = collection @tags = end |
Instance Attribute Details
#collection ⇒ Object
Returns the value of attribute collection.
12 13 14 |
# File 'lib/lifer/builder/html/from_liquid/drops/entry_drop.rb', line 12 def collection @collection end |
#lifer_entry ⇒ Object
Returns the value of attribute lifer_entry.
12 13 14 |
# File 'lib/lifer/builder/html/from_liquid/drops/entry_drop.rb', line 12 def lifer_entry @lifer_entry end |
Instance Method Details
#author ⇒ String
The entry author (or authors).
23 |
# File 'lib/lifer/builder/html/from_liquid/drops/entry_drop.rb', line 23 def = |
#authors ⇒ String
The entry authors (or author).
28 |
# File 'lib/lifer/builder/html/from_liquid/drops/entry_drop.rb', line 28 def = (@authors ||= lifer_entry..join(", ")) |
#content ⇒ String
The entry content.
33 |
# File 'lib/lifer/builder/html/from_liquid/drops/entry_drop.rb', line 33 def content = (@content ||= lifer_entry.to_html) |
#frontmatter ⇒ FrontmatterDrop
The entry frontmatter data.
38 |
# File 'lib/lifer/builder/html/from_liquid/drops/entry_drop.rb', line 38 def frontmatter = (@frontmatter ||= FrontmatterDrop.new(lifer_entry)) |
#path ⇒ String
The path to the entry.
43 |
# File 'lib/lifer/builder/html/from_liquid/drops/entry_drop.rb', line 43 def path = (@path ||= lifer_entry.path) |
#permalink ⇒ String
The entry permalink.
48 |
# File 'lib/lifer/builder/html/from_liquid/drops/entry_drop.rb', line 48 def permalink = (@permalink ||= lifer_entry.permalink) |
#published_at ⇒ String
The entry publication date (as a string).
53 |
# File 'lib/lifer/builder/html/from_liquid/drops/entry_drop.rb', line 53 def published_at = (@published_at ||= lifer_entry.published_at) |
#summary ⇒ String
The summary of the entry.
58 |
# File 'lib/lifer/builder/html/from_liquid/drops/entry_drop.rb', line 58 def summary = (@summary ||= lifer_entry.summary) |
#title ⇒ String
The entry title.
63 |
# File 'lib/lifer/builder/html/from_liquid/drops/entry_drop.rb', line 63 def title = (@title ||= lifer_entry.title) |
#updated_at ⇒ String
The entry’s last updated date (as a string).
68 |
# File 'lib/lifer/builder/html/from_liquid/drops/entry_drop.rb', line 68 def updated_at = (@updated_at ||= lifer_entry.updated_at) |