1
0
mirror of https://github.com/prometheus/docs.git synced 2026-02-07 03:44:55 +01:00
Files
docs/lib/default.rb
Tobias Schmidt ed12a65c95 Default arch download default to amd64
Remove the popular option as it only included a single item.
2016-04-16 22:50:23 -04:00

27 lines
729 B
Ruby

# All files in the 'lib' directory will be loaded
# before nanoc starts compiling.
require 'nanoc/cachebuster'
include Nanoc::Helpers::LinkTo
include Nanoc::Helpers::Rendering
include Nanoc3::Helpers::Blogging
include Nanoc3::Helpers::Tagging
include Nanoc::Helpers::CacheBusting
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