1
0
mirror of https://github.com/prometheus/docs.git synced 2026-02-06 09:44:54 +01:00
Files
docs/lib/default.rb
Ben Kochie 1c4d72e0a6 Upgrade to Nanoc 4.0
* Update Ruby gems.
* Remove nanoc-cachebuster due to incompatibility.
* Add README item about GitHub auth to improve build reliability.
* Fix various required config changes for 4.0

Signed-off-by: Ben Kochie <superq@gmail.com>
2018-08-18 10:52:15 +02:00

24 lines
661 B
Ruby

# All files in the 'lib' directory will be loaded
# before nanoc starts compiling.
include Nanoc::Helpers::LinkTo
include Nanoc::Helpers::Rendering
include Nanoc::Helpers::Blogging
include Nanoc::Helpers::Tagging
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 +
"<div class='read-more'><a class='btn btn-primary' href='#{post.path}'>Continue reading &raquo;</a></div>"
end
return content
end
end
include BlogHelper