diff --git a/website/config.rb b/website/config.rb index 5e6629ca4..e0164d430 100644 --- a/website/config.rb +++ b/website/config.rb @@ -6,3 +6,61 @@ activate :hashicorp do |h| h.github_slug = "hashicorp/vault" h.website_root = "website" end + +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} - Vault by HashiCorp" + end + + "Vault 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.start_with?(expected) + return " class=\"active\"" + else + return "" + end + end + + # Returns the id for this page. + # @return [String] + def body_id_for(page) + if name = page.data.sidebar_current && !name.blank? + return "page-#{name.strip}" + end + return "page-home" + end + + # Returns the list of classes for this page. + # @return [String] + def body_classes_for(page) + classes = [] + + if page && page.data.layout + classes << "layout-#{page.data.layout}" + end + + classes << "-displaying-bnr" + + return classes.join(" ") + end +end diff --git a/website/helpers/sidebar_helpers.rb b/website/helpers/sidebar_helpers.rb deleted file mode 100644 index 124a7c53c..000000000 --- a/website/helpers/sidebar_helpers.rb +++ /dev/null @@ -1,12 +0,0 @@ -module SidebarHelpers - # 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 -end diff --git a/website/source/assets/stylesheets/hashicorp-shared/_hashicorp-sidebar.scss b/website/source/assets/stylesheets/hashicorp-shared/_hashicorp-sidebar.scss index 99f77f6c5..a8564f209 100644 --- a/website/source/assets/stylesheets/hashicorp-shared/_hashicorp-sidebar.scss +++ b/website/source/assets/stylesheets/hashicorp-shared/_hashicorp-sidebar.scss @@ -143,11 +143,11 @@ $sidebar-icon-height: 20px; } .sidebar-image { - padding-top: 24px; - img { - display: block; - margin: 0 auto; - } + background-image: image-url('logo-header.svg'); + background-position: center center; + background-repeat: no-repeat; + height: 72px; + margin-top: 24px; } @@ -250,17 +250,6 @@ $sidebar-icon-height: 20px; min-width: $sidebar-width; width: $sidebar-width; } - - .sidebar .sidebar-header { - //height: $sidebar-width * 9/16; // 16:9 header dimension - } - - .sidebar .sidebar-image { - /* img { - width: $sidebar-width/4 - $sidebar-padding; - height: $sidebar-width/4 - $sidebar-padding; - } */ - } } .sidebar-overlay { diff --git a/website/source/layouts/_announcement-bnr.erb b/website/source/layouts/_announcement-bnr.erb deleted file mode 100644 index 77bf4f0dc..000000000 --- a/website/source/layouts/_announcement-bnr.erb +++ /dev/null @@ -1,18 +0,0 @@ -
- Announcing - - <%= partial "layouts/svg/svg-enterprise" %> - - Secure Infrastructure Automation. - - Find out more - -
-