From 00f303b393fd3a3a615065b52c7e241067dce598 Mon Sep 17 00:00:00 2001 From: "parsiya@gmail.com" Date: Wed, 17 Aug 2016 00:57:28 -0400 Subject: Handle absence of sidebarMenuEnabled and sidebarRecentLimit. Fixes #20 --- layouts/partials/sidebar.html | 48 +++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index a22412b..1cb3fec 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -42,32 +42,36 @@ first we check if it is enabled in config file and then start adding the items if Site.Params.sidebarNewWindow exists and is set to true then open these links in a new window --> - {{ if eq .Site.Params.sidebarMenuEnabled true }} -
- {{ if isset .Site.Params "sidebarMenuHeader" }} -

{{ .Site.Params.sidebarMenuHeader }}

- {{ end }} - {{ range .Site.Menus.sidebar }} -
  • - {{ .Name }} -
  • - {{ end }} -
    + {{ with .Site.Params.sidebarMenuEnabled }} + {{ if eq . true }} +
    + {{ if isset $.Site.Params "sidebarMenuHeader" }} +

    {{ $.Site.Params.sidebarMenuHeader }}

    + {{ end }} + {{ range $.Site.Menus.sidebar }} +
  • + {{ .Name }} +
  • + {{ end }} +
    + {{ end }} {{ end }} - {{ if not (eq .Site.Params.sidebarRecentLimit 0) }} -
    -

    Recent Posts

    - -
    + {{ with .Site.Params.sidebarRecentLimit }} + {{ if not (eq $.Site.Params.sidebarRecentLimit 0) }} +
    +

    Recent Posts

    + +
    + {{ end }} {{ end }} -- cgit v1.2.3