Class: RageRender::ChapterDrop
- Inherits:
-
Jekyll::Drops::DocumentDrop
- Object
- Jekyll::Drops::DocumentDrop
- RageRender::ChapterDrop
show all
- Extended by:
- Forwardable, Pipettes
- Defined in:
- lib/ragerender/jekyll/chapter.rb
Overview
Values to pass to the archive layout when rendering a chapter.
Constant Summary
collapse
- COVER_MAX_HEIGHT =
420
- COVER_MAX_WIDTH =
300
Instance Method Summary
collapse
Methods included from Pipettes
clean_payload, def_data_delegator, def_image_metadata, def_loop, def_pages, def_safe_delegator, extended, loops, own_methods
Instance Method Details
#chapterid ⇒ Object
84
85
86
|
# File 'lib/ragerender/jekyll/chapter.rb', line 84
def chapterid
@obj.collection.docs.sort_by(&:path).index @obj
end
|
#chaptername ⇒ Object
88
89
90
|
# File 'lib/ragerender/jekyll/chapter.rb', line 88
def chaptername
escape @obj.data['title']
end
|
#cover_height_small ⇒ Object
96
97
98
|
# File 'lib/ragerender/jekyll/chapter.rb', line 96
def cover_height_small
scaled_height(cover_width, cover_height, COVER_MAX_WIDTH, COVER_MAX_HEIGHT)
end
|
#cover_width_small ⇒ Object
92
93
94
|
# File 'lib/ragerender/jekyll/chapter.rb', line 92
def cover_width_small
scaled_width(cover_width, cover_height, COVER_MAX_WIDTH, COVER_MAX_HEIGHT)
end
|
#firstcomicinchapter ⇒ Object
100
101
102
|
# File 'lib/ragerender/jekyll/chapter.rb', line 100
def firstcomicinchapter
first_comic&.url
end
|
#to_liquid ⇒ Object
104
105
106
107
108
|
# File 'lib/ragerender/jekyll/chapter.rb', line 104
def to_liquid
super.reject do |k, v|
Jekyll::Drops::DocumentDrop::NESTED_OBJECT_FIELD_BLACKLIST.include? k
end.to_h
end
|