From 13ca50102c812ccd2540a07c83a19915d2dabdab Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Mon, 6 Oct 2014 19:13:22 -0400 Subject: [PATCH] Move sidebar helper inline --- website/config.rb | 11 +++++++++++ website/helpers/sidebar_helpers.rb | 12 ------------ 2 files changed, 11 insertions(+), 12 deletions(-) delete mode 100644 website/helpers/sidebar_helpers.rb diff --git a/website/config.rb b/website/config.rb index da0e329760..ff63c0ec8b 100644 --- a/website/config.rb +++ b/website/config.rb @@ -17,4 +17,15 @@ configure :build do activate :asset_hash activate :minify_html activate :minify_javascript +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 end diff --git a/website/helpers/sidebar_helpers.rb b/website/helpers/sidebar_helpers.rb deleted file mode 100644 index 124a7c53c6..0000000000 --- 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