2014-10-21 19:55:55 +02:00
|
|
|
# All files in the 'lib' directory will be loaded
|
|
|
|
|
# before nanoc starts compiling.
|
|
|
|
|
|
|
|
|
|
include Nanoc::Helpers::LinkTo
|
2014-12-22 03:37:54 +01:00
|
|
|
include Nanoc::Helpers::Rendering
|
2018-07-12 12:14:37 +02:00
|
|
|
include Nanoc::Helpers::Blogging
|
|
|
|
|
include Nanoc::Helpers::Tagging
|
2015-04-22 15:50:09 +02:00
|
|
|
|
|
|
|
|
module BlogHelper
|
|
|
|
|
def get_pretty_date(post)
|
|
|
|
|
attribute_to_time(post[:created_at]).strftime('%B %-d, %Y')
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def get_post_start(post)
|
|
|
|
|
content = post.compiled_content
|
|
|
|
|
if content =~ /\s<!-- more -->\s/
|
|
|
|
|
content = content.partition('<!-- more -->').first +
|
2016-04-15 20:55:47 +02:00
|
|
|
"<div class='read-more'><a class='btn btn-primary' href='#{post.path}'>Continue reading »</a></div>"
|
2015-04-22 15:50:09 +02:00
|
|
|
end
|
|
|
|
|
return content
|
2016-04-04 02:10:48 +02:00
|
|
|
end
|
2015-04-22 15:50:09 +02:00
|
|
|
end
|
|
|
|
|
include BlogHelper
|