Skip to content

Commit

Permalink
Wide mode with sidebar for single pages
Browse files Browse the repository at this point in the history
  • Loading branch information
szpak committed Mar 6, 2020
1 parent b5d130b commit 8649697
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
17 changes: 16 additions & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{{ define "main" }}

{{ if $.Param "enableSidebarSingle" }}
<main class="main inner" data-sidebar-position="{{ $.Param "sidebarPosition" }}">
<div class="list__main wrapper {{ if $.Param "enableSidebar" }}{{ if eq ($.Param "sidebarPosition") "left" }}mr{{ else }}lm{{ end }}{{ else }}lmr{{ end }}">
{{ end }}

<main class="single__main {{ if or ($.Param "enableToc") ($.Param "toc") }}{{ if $.Param "hideToc" }}main{{ else if eq ($.Param "tocPosition") "outer" }}main{{ else }}main-main{{ end }}{{ else }}main{{ end }}">
{{ if $.Param "enableBreadcrumb" }}
{{ partial "body/breadcrumb" . }}
Expand Down Expand Up @@ -39,11 +44,21 @@ <h2 class="single__title" data-ani="{{ $.Site.Params.enableUiAnimation | default
</div>
</main>

{{ if and (or ($.Param "enableToc") ($.Param "toc")) (ne ($.Param "tocPosition") "outer") }}
{{ if and (or ($.Param "enableToc") ($.Param "toc")) (ne ($.Param "tocPosition") "outer") (not ($.Param "enableSidebarSingle")) }}
<aside class="single__side {{ if or ($.Param "enableToc") ($.Param "toc") }}main-side{{ end }}">
{{ partial "sidebar/sidebar-single" . }}
</aside>
{{ end }}

{{ if $.Param "enableSidebarSingle" }}
</div>
<aside class="list__sidebar {{ if eq ($.Param "sidebarPosition") "left" }}l{{ else }}r{{ end }}" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
{{ partial "sidebar/sidebar-home" . }}
</aside>
</main>
{{ partial "script/sidebar-script" . }}
{{ end }}

<script>
{{ $enableToc:= $.Param "enableToc" }}
{{ $toc:= $.Param "toc" }}
Expand Down
18 changes: 17 additions & 1 deletion layouts/about/single.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{{ define "main" }}

{{ if $.Param "enableSidebarSingle" }}
<main class="main inner" data-sidebar-position="{{ $.Param "sidebarPosition" }}">
<div class="list__main list__main--about {{ if $.Param "enableSidebar" }}{{ if eq ($.Param "sidebarPosition") "left" }}mr{{ else }}lm{{ end }}{{ else }}lmr{{ end }}">
{{ end }}

<header class="header basicflex-column">
<h3 class="h3 terms__title">
{{ .Title }}
Expand All @@ -13,4 +19,14 @@ <h3 class="h3 terms__title">
{{ partial "search/site-search" . }}
</div>
{{ partial "script/about-script" . }}
{{ end }}

{{ if $.Param "enableSidebarSingle" }}
</div>
<aside class="list__sidebar {{ if eq ($.Param "sidebarPosition") "left" }}l{{ else }}r{{ end }}" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
{{ partial "sidebar/sidebar-home" . }}
</aside>
</main>
{{ partial "script/sidebar-script" . }}
{{ end }}

{{ end }}
14 changes: 14 additions & 0 deletions layouts/talks/list.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{{ define "main" }}
{{ $titleWrap := .Params.titleWrap }}

{{ if $.Param "enableSidebarSingle" }}
<main class="main inner" data-sidebar-position="{{ $.Param "sidebarPosition" }}">
<div class="list__main {{ if $.Param "enableSidebar" }}{{ if eq ($.Param "sidebarPosition") "left" }}mr{{ else }}lm{{ end }}{{ else }}lmr{{ end }}">
{{ end }}

<header class="header basicflex-column">
<h3 class="h3 terms__title">
{{ .Title }}
Expand Down Expand Up @@ -53,4 +58,13 @@ <h6 class="archive__subtitle h6">
</div>
{{ partial "script/archive-script" . }}
</main>

{{ if $.Param "enableSidebarSingle" }}
</div>
<aside class="list__sidebar {{ if eq ($.Param "sidebarPosition") "left" }}l{{ else }}r{{ end }}" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
{{ partial "sidebar/sidebar-home" . }}
</aside>
</main>
{{ end }}

{{ end }}

0 comments on commit 8649697

Please sign in to comment.