2014-02-08 00:41:03 +00:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
# Configure Middleman
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2014-10-18 23:18:50 +00:00
|
|
|
set :base_url, "https://www.consul.io/"
|
|
|
|
|
2014-10-06 23:15:01 +00:00
|
|
|
activate :hashicorp do |h|
|
2015-10-25 21:46:22 +00:00
|
|
|
h.name = "consul"
|
2017-01-26 18:16:11 +00:00
|
|
|
h.version = "0.7.3"
|
2015-10-25 21:46:22 +00:00
|
|
|
h.github_slug = "hashicorp/consul"
|
2014-10-06 23:15:01 +00:00
|
|
|
end
|
2014-02-08 00:41:03 +00:00
|
|
|
|
2014-10-06 23:13:22 +00:00
|
|
|
helpers do
|
|
|
|
# This helps by setting the "active" class for sidebar nav elements
|
|
|
|
# if the YAML frontmatter matches the expected value.
|
|
|
|
def sidebar_current(expected)
|
|
|
|
current = current_page.data.sidebar_current || ""
|
|
|
|
if current.start_with?(expected)
|
|
|
|
return " class=\"active\""
|
|
|
|
else
|
|
|
|
return ""
|
|
|
|
end
|
|
|
|
end
|
2014-12-30 18:18:25 +00:00
|
|
|
|
|
|
|
# Get the title for the page.
|
|
|
|
#
|
|
|
|
# @param [Middleman::Page] page
|
|
|
|
#
|
|
|
|
# @return [String]
|
|
|
|
def title_for(page)
|
|
|
|
if page && page.data.page_title
|
|
|
|
return "#{page.data.page_title} - Consul by HashiCorp"
|
|
|
|
end
|
|
|
|
|
|
|
|
"Consul by HashiCorp"
|
|
|
|
end
|
2016-10-31 19:49:52 +00:00
|
|
|
|
|
|
|
# Get the description for the page
|
|
|
|
#
|
|
|
|
# @param [Middleman::Page] page
|
|
|
|
#
|
|
|
|
# @return [String]
|
|
|
|
def description_for(page)
|
2016-12-07 19:32:35 +00:00
|
|
|
description = page.data.description || ""
|
|
|
|
description = description.gsub(/\n+/, " ")
|
|
|
|
return escape_html(description)
|
2016-10-31 19:49:52 +00:00
|
|
|
end
|
2014-02-08 00:41:03 +00:00
|
|
|
end
|