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 9, 2020
1 parent b5d130b commit b44e036
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 4 deletions.
19 changes: 17 additions & 2 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{{ define "main" }}

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

<main class="single__main {{ if $.Param "enableSidebarSingle" }}main-embedded {{ end }}{{ 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" . }}
{{ end }}
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 }}
2 changes: 2 additions & 0 deletions layouts/partials/sidebar/sidebar-home.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{{ if $.Param "enableSidebar" }}
<div class="sidebar">
{{ if .IsHome }}
{{ partial "search/site-search" . }}
{{ end }}
{{ partial "sidebar/site-bio" . }}
{{ partial "sidebar/custom-home" . }}
{{ partial "sidebar/list/posts-by-order" . }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/sidebar/site-bio.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
{{ end }}
{{ end }}
</div>
{{ end }}
<hr class="hr-slash bio-hr"/>
{{ end }}
<div class="bio__name">
{{ $.Param "myname" }}
</div>
Expand Down
16 changes: 16 additions & 0 deletions layouts/showcase/list.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 {{ if $.Param "enableSidebar" }}{{ if eq ($.Param "sidebarPosition") "left" }}mr{{ else }}lm{{ end }}{{ else }}lmr{{ end }}">
{{ end }}

<main class="main showcase inner" data-sidebar-position="{{ $.Param "sidebarPosition" }}">
{{ if .Params.enableBio }}
<aside class="{{ if eq ($.Param "sidebarPosition") "left" }}l{{ else }}r{{ end }}">
Expand Down Expand Up @@ -29,4 +35,14 @@
</div>
{{ end }}
</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>
{{ partial "script/sidebar-script" . }}
{{ end }}

{{ end }}
15 changes: 15 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,14 @@ <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>
{{ partial "script/sidebar-script" . }}
{{ end }}

{{ end }}

0 comments on commit b44e036

Please sign in to comment.