2014-10-21 22:21:19 -05:00
|
|
|
set :base_url, "https://www.terraform.io/"
|
|
|
|
|
2014-10-13 11:44:38 -05:00
|
|
|
activate :hashicorp do |h|
|
2015-10-25 22:58:36 -05:00
|
|
|
h.name = "terraform"
|
2016-11-04 11:31:49 -05:00
|
|
|
h.version = "0.7.9"
|
2015-10-25 22:58:36 -05:00
|
|
|
h.github_slug = "hashicorp/terraform"
|
2014-07-28 09:08:29 -05:00
|
|
|
end
|
2016-10-31 17:36:33 -05:00
|
|
|
|
|
|
|
helpers do
|
|
|
|
# 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} - Terraform by HashiCorp"
|
|
|
|
end
|
|
|
|
|
|
|
|
"Terraform 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
|
|
|
|
|
|
|
|
# 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 == expected or (expected.is_a?(Regexp) and expected.match(current))
|
|
|
|
return " class=\"active\""
|
|
|
|
else
|
|
|
|
return ""
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|