Class: RageRender::WebcomicDrop
- Inherits:
-
Jekyll::Drops::Drop
- Object
- Jekyll::Drops::Drop
- RageRender::WebcomicDrop
show all
- Extended by:
- Forwardable, Pipettes
- Defined in:
- lib/ragerender/jekyll.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Pipettes
clean_payload, def_data_delegator, def_image_metadata, extended
Class Method Details
.def_config_delegator(source, target) ⇒ Object
128
129
130
|
# File 'lib/ragerender/jekyll.rb', line 128
def self.def_config_delegator source, target
define_method(target) { @obj.site.config[source.to_s] }
end
|
Instance Method Details
#banner ⇒ Object
157
158
159
|
# File 'lib/ragerender/jekyll.rb', line 157
def banner
Pathname.new(@obj.site.baseurl || '/').join(@obj.site.config['banner'] || '').to_path
end
|
#cfscriptcode ⇒ Object
184
185
186
187
188
189
190
|
# File 'lib/ragerender/jekyll.rb', line 184
def cfscriptcode
<<~HTML
<script type="text/javascript">
function jumpTo(place) { window.location = place; }
</script>
HTML
end
|
#copyrights ⇒ Object
153
154
155
|
# File 'lib/ragerender/jekyll.rb', line 153
def copyrights
escape @obj.site.config['copyrights'].gsub('[year]', Date.today.year.to_s)
end
|
#css ⇒ Object
192
193
194
195
196
|
# File 'lib/ragerender/jekyll.rb', line 192
def css
css_files = @obj.site.static_files.select {|f| f.extname == '.css'}.map(&:path).to_a
css_files << Pathname.new(@obj.site.theme.includes_path).join('layout.css') unless css_files.any?
css_files.map {|f| File.read f }.join
end
|
178
179
180
181
182
|
# File 'lib/ragerender/jekyll.rb', line 178
def
@obj.site.pages.reject {|page| page.data['hidden'] }.map do |page|
{'link' => page.url, 'title' => escape(page.data['title'])}
end
end
|
#fallback_data ⇒ Object
218
219
220
|
# File 'lib/ragerender/jekyll.rb', line 218
def fallback_data
{}
end
|
#hasblogs ⇒ Object
170
171
172
|
# File 'lib/ragerender/jekyll.rb', line 170
def hasblogs
@obj.site.posts.docs.any?
end
|
#hidefromhost ⇒ Object
174
175
176
|
# File 'lib/ragerender/jekyll.rb', line 174
def hidefromhost
false
end
|
#iscomicpage ⇒ Object
210
211
212
|
# File 'lib/ragerender/jekyll.rb', line 210
def iscomicpage
@obj.type == :comics
end
|
214
215
216
|
# File 'lib/ragerender/jekyll.rb', line 214
def
@obj.type == :pages && @obj.data['hidden'] != true
end
|
#lastupdatedmy ⇒ Object
149
150
151
|
# File 'lib/ragerender/jekyll.rb', line 149
def lastupdatedmy
Time.now.strftime('%d/%m/%Y')
end
|
#layoutcss ⇒ Object
198
199
200
201
202
203
204
|
# File 'lib/ragerender/jekyll.rb', line 198
def layoutcss
<<~HTML
<style type="text/css">
#{css}
</style>
HTML
end
|
#pagetitle ⇒ Object
206
207
208
|
# File 'lib/ragerender/jekyll.rb', line 206
def pagetitle
escape @obj.data['title']
end
|
#webcomicavatar ⇒ Object
161
162
163
|
# File 'lib/ragerender/jekyll.rb', line 161
def webcomicavatar
Pathname.new(@obj.site.baseurl || '/').join(@obj.site.config['webcomicavatar'] || '').to_path
end
|
#webcomicicon ⇒ Object
165
166
167
|
# File 'lib/ragerender/jekyll.rb', line 165
def webcomicicon
@obj.site.config.fetch('webcomicavatar', '')
end
|
#webcomicname ⇒ Object
137
138
139
|
# File 'lib/ragerender/jekyll.rb', line 137
def webcomicname
escape @obj.site.config['title']
end
|
#webcomicslogan ⇒ Object
141
142
143
|
# File 'lib/ragerender/jekyll.rb', line 141
def webcomicslogan
escape @obj.site.config['description']
end
|
#webcomicurl ⇒ Object
145
146
147
|
# File 'lib/ragerender/jekyll.rb', line 145
def webcomicurl
@obj.site.baseurl
end
|