Skip to content

Commit

Permalink
Merge pull request #760 from gethinode/develop
Browse files Browse the repository at this point in the history
Fix sidebar rendering
  • Loading branch information
markdumay authored Feb 8, 2024
2 parents 4db9c6f + fbaa5bc commit 8671348
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
14 changes: 12 additions & 2 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@
{{ $sidebar := .Render "single/sidebar" }}
{{ $toc := .Render "single/panel-toc" }}

{{ $sidebar | safeHTML }}

{{ with $sidebar }}
<div class="offcanvas offcanvas-start" tabindex="-1" id="offcanvass-sidebar" aria-inledby="offcanvas-label">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="offcanvas-label">{{ strings.FirstUpper $.Section }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="{{ T "close" }}"></button>
</div>
<div class="offcanvas-body">
{{ . | safeHTML }}
</div>
</div>
{{ end }}

<div class="container-xxl flex-fill p-4 px-xxl-0">
{{ if $sidebar -}}
<div class="row row-cols-1 row-cols-{{ $breakpoint.current }}-2 row-cols-{{ $breakpoint.next }}-3">
Expand Down
16 changes: 2 additions & 14 deletions layouts/_default/single/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@
{{- $version := .Scratch.Get "version" -}}
{{ $sidebar := "" }}
{{- $hasSidebar := .Site.Params.navigation.sidebar | default true -}}
{{ if and $menu $hasSidebar }}{{ $sidebar = partial "assets/sidebar.html" (dict "page" . "menu" $menu "version" $version) }}{{ end }}

{{ if $sidebar -}}
<div class="offcanvas offcanvas-start" tabindex="-1" id="offcanvass-sidebar" aria-inledby="offcanvas-label">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="offcanvas-label">{{ strings.FirstUpper $.Section }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="{{ T "close" }}"></button>
</div>
<div class="offcanvas-body">
{{ $sidebar | safeHTML }}
</div>
</div>
{{ else if .Site.Params.navigation.sidebar }}
&nbsp;
{{ if and $menu $hasSidebar }}
{{ partial "assets/sidebar.html" (dict "page" . "menu" $menu "version" $version) }}
{{ end }}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gethinode/hinode",
"version": "0.23.0-beta2",
"version": "0.23.0-beta3",
"description": "Hinode is a clean documentation and blog theme for Hugo, an open-source static site generator",
"keywords": [
"hugo",
Expand Down

0 comments on commit 8671348

Please sign in to comment.