2d29c510dc
This has been working really well on Nomad and hashicorp.com, so I am ready to port it out to Consul as a beta. This moves the local development to a Docker container, which is the same container that we use to publish the website in production. The result is much faster and more consistent deploys.
47 lines
1.1 KiB
Ruby
47 lines
1.1 KiB
Ruby
#-------------------------------------------------------------------------
|
|
# Configure Middleman
|
|
#-------------------------------------------------------------------------
|
|
|
|
set :base_url, "https://www.consul.io/"
|
|
|
|
activate :hashicorp do |h|
|
|
h.name = "consul"
|
|
h.version = "0.7.0"
|
|
h.github_slug = "hashicorp/consul"
|
|
end
|
|
|
|
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
|
|
|
|
# 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
|
|
|
|
# Get the description for the page
|
|
#
|
|
# @param [Middleman::Page] page
|
|
#
|
|
# @return [String]
|
|
def description_for(page)
|
|
return escape_html(page.data.description || "")
|
|
end
|
|
end
|