Added the option to show the sidebar on other pages (#2)
Added settings to show the sidebar on posts and other pages, in addition to the home page.
This commit is contained in:
parent
d70e270ed0
commit
8a80ab665d
2 changed files with 18 additions and 2 deletions
|
|
@ -1,4 +1,8 @@
|
|||
{{ if .IsHome -}}
|
||||
{{ $isPost := eq .Page.Type "post" -}}
|
||||
{{ $showOnPosts := $.Site.Params.sidebar_show_on_posts -}}
|
||||
{{ $showOnPages := $.Site.Params.sidebar_show_on_pages -}}
|
||||
{{ $shouldShowSidebar := or .IsHome (and $showOnPosts $isPost) (and $showOnPages (not $isPost)) -}}
|
||||
{{ if $shouldShowSidebar -}}
|
||||
<div class="sidebar">
|
||||
{{ if templates.Exists "partials/sidebar.html" }}
|
||||
{{ partial "sidebar.html" . }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue