From 8a80ab665d6977f71c1ae090cdf85272ed943833 Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Thu, 26 Dec 2024 14:32:20 +1100 Subject: [PATCH] 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. --- .../partials/sidebar-for-tiny-theme/sidebar.html | 6 +++++- plugin.json | 14 +++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/layouts/partials/sidebar-for-tiny-theme/sidebar.html b/layouts/partials/sidebar-for-tiny-theme/sidebar.html index 70ac4e8..69c1d8d 100644 --- a/layouts/partials/sidebar-for-tiny-theme/sidebar.html +++ b/layouts/partials/sidebar-for-tiny-theme/sidebar.html @@ -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 -}}