sidebar-for-bayou/layouts/partials/sidebar-for-tiny-theme/sidebar.html
Leon Mika 8a80ab665d
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.
2024-12-26 14:32:20 +11:00

13 lines
509 B
HTML

{{ $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" . }}
{{ else }}
{{ partial "sidebar-for-tiny-theme/recommendations.html" . }}
{{ end }}
</div>
{{ end -}}