Moved sidebar out of microhook

Moved the sidebar out of the after-post-list microhook and into the base theme template. This should resolve the styling issue which will break sites using the before-post-list microhook. This does tie the plugin to Tiny-theme baseof theme, which is not great. Will need to resolve this in some way, but should work for now.
This commit is contained in:
Leon Mika 2024-03-24 12:06:08 +11:00
parent a9f0437fc7
commit 7a3eb89fd8
5 changed files with 31 additions and 4 deletions

View file

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
{{ partial "head.html" . }}
<body>
{{ partial "header.html" . }}
<div class="page-content">
<div class="wrapper">
{{ block "main" . }}{{ end }}
</div>
{{ partial "sidebar-for-tiny-theme/sidebar.html" . }}
</div>
{{ partial "footer.html" . }}
{{ range .Site.Params.plugins_js }}
<script src="{{ . }}"></script>
{{ end }}
{{ if templates.Exists "partials/microhook-before-closing-body.html" }}
{{ partial "microhook-before-closing-body.html" . }}
{{ end }}
</body>
</html>

View file

@ -1 +0,0 @@
{{ partial "sidebar-for-tiny-theme/sidebar.html" . }}

View file

@ -1,3 +1,4 @@
{{ if .IsHome -}}
<div class="sidebar"> <div class="sidebar">
{{ if templates.Exists "partials/sidebar.html" }} {{ if templates.Exists "partials/sidebar.html" }}
{{ partial "sidebar.html" . }} {{ partial "sidebar.html" . }}
@ -5,3 +6,4 @@
{{ partial "sidebar-for-tiny-theme/recommendations.html" . }} {{ partial "sidebar-for-tiny-theme/recommendations.html" . }}
{{ end }} {{ end }}
</div> </div>
{{ end -}}

View file

@ -1,5 +1,5 @@
{ {
"version": "1.0.1", "version": "1.0.2",
"title": "Sidebar for Tiny Theme", "title": "Sidebar for Tiny Theme",
"description": "Adds a sidebar to a blog using Tiny Theme", "description": "Adds a sidebar to a blog using Tiny Theme",
"includes": [ "includes": [

View file

@ -3,7 +3,7 @@
max-width: 50em; max-width: 50em;
} }
div.wrapper:has(div.sidebar) { div.page-content:has(div.sidebar) {
display: grid; display: grid;
grid-template-columns: minmax(20em,35em) 15em; grid-template-columns: minmax(20em,35em) 15em;
column-gap: 60px; column-gap: 60px;