From 63399e6bf8e08607b5252c06ecea7ff8d243995a Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Sat, 6 Jul 2019 17:37:08 +0200 Subject: [PATCH] Cleanup the menu partials, utilize Hugo features and performance better. --- README.md | 9 +++++++++ layouts/partials/menu.html | 9 +++------ layouts/partials/mobilemenu.html | 9 +++------ layouts/partials/sidebar.html | 2 +- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index aa3264e..9926c35 100644 --- a/README.md +++ b/README.md @@ -225,6 +225,15 @@ To customise a layout included in the zen theme, copy it to the root layout dire Add any new layouts to the root layout directory as well. This way they will not be overwritten when updating the theme. +#### Menu and sidebar layouts + +The default menu will automatically have entries for the home page, each root page and each section, in that order. + +If the default sidebar is activated it will display each section with all its pages listed below. + +They are set up in `layouts/partials/menu.html`, `layouts/partials/mobilmenu.html` and `layouts/partials/sidebar.html`. The default works nicely for small sites but in many cases they will need to be customised. + + ### Styles and scripts Styles and scripts are processed with Hugo pipes that was added in Hugo 0.46. diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index 8515210..ce87e58 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -1,17 +1,14 @@ -{{ $home := relLangURL "/" -}} {{ $currentSection := .Section -}} {{ $currentID := "" -}} {{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}