Skip to content

Commit

Permalink
feat: add the option to hide the sidebar on post pages
Browse files Browse the repository at this point in the history
  • Loading branch information
lxndrblz committed Mar 6, 2022
1 parent d444934 commit a9d3b1d
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 10 deletions.
8 changes: 8 additions & 0 deletions assets/scss/partials/components/_wrapper.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
@include widescreen {
width: calc(#{$content-ratio} * 80%);
}

&--sidebarhidden {
width: 100%;
}
}

&__sidebar {
Expand All @@ -34,5 +38,9 @@
@include widescreen {
width: calc(#{$sidebar-ratio} * 80%);
}

&--sidebarhidden {
display: none;
}
}
}
2 changes: 2 additions & 0 deletions exampleSite/config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ listDateFormat = "2/1/2006"

reversepagetitle = true # When set to 'true', the Window Title will be reversed to 'Title | Author' instead of the default 'Author | Title'

hidesidebar = true

[simpleAnalytics]
# enable = true
# customurl = "https://analytics.example.com"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Target":"scss/main.rtl.min.68a91cfe62515ca9c1fd6e2785ff8c2ea8d34bed001153ff72cb786eff11aed7.css","MediaType":"text/css","Data":{"Integrity":"sha256-aKkc/mJRXKnB/W4nhf+MLqjTS+0AEVP/cst4bv8Rrtc="}}
{"Target":"scss/main.rtl.min.b18ec4bebe7dec033a3938c703e3999fffd65088376baf653784e724cf7a853f.css","MediaType":"text/css","Data":{"Integrity":"sha256-sY7Evr597AM6OTjHA+OZn//WUIg3a69lN4TnJM96hT8="}}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Target":"scss/main.min.887981ea8ee463aed275e813b62ca5ceba5547658ae54bc026235d498d7503d6.css","MediaType":"text/css","Data":{"Integrity":"sha256-iHmB6o7kY67SdegTtiylzrpVR2WK5UvAJiNdSY11A9Y="}}
{"Target":"scss/main.min.b28b1ec8b3eb3938701c025f40f5401480195fb6cf744f427e2116d27d34ec3d.css","MediaType":"text/css","Data":{"Integrity":"sha256-soseyLPrOThwHAJfQPVAFIAZX7bPdE9CfiEW0n007D0="}}
20 changes: 18 additions & 2 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,26 @@
{{ end }}
>
<div class="wrapper">
<aside class="wrapper__sidebar">
<aside
{{ if and ( or (eq .Type "post") (eq .Type .Site.Params.postSectionName)) (eq .Site.Params.hidesidebar true) }}
class="wrapper__sidebar--sidebarhidden"

{{ else }}
class="wrapper__sidebar"

{{ end }}
>
{{- partial "sidebar.html" . -}}
</aside>
<main class="wrapper__main">
<main
{{ if and ( or (eq .Type "post") (eq .Type .Site.Params.postSectionName)) (eq .Site.Params.hidesidebar true) }}
class="wrapper__main--sidebarhidden"

{{ else }}
class="wrapper__main"

{{ end }}
>
<header class="header">{{ partial "navbar.html" . }}</header>
{{- block "main" . }}{{- end }}
</main>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Target":"scss/main.rtl.min.68a91cfe62515ca9c1fd6e2785ff8c2ea8d34bed001153ff72cb786eff11aed7.css","MediaType":"text/css","Data":{"Integrity":"sha256-aKkc/mJRXKnB/W4nhf+MLqjTS+0AEVP/cst4bv8Rrtc="}}
{"Target":"scss/main.rtl.min.b18ec4bebe7dec033a3938c703e3999fffd65088376baf653784e724cf7a853f.css","MediaType":"text/css","Data":{"Integrity":"sha256-sY7Evr597AM6OTjHA+OZn//WUIg3a69lN4TnJM96hT8="}}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Target":"scss/main.min.887981ea8ee463aed275e813b62ca5ceba5547658ae54bc026235d498d7503d6.css","MediaType":"text/css","Data":{"Integrity":"sha256-iHmB6o7kY67SdegTtiylzrpVR2WK5UvAJiNdSY11A9Y="}}
{"Target":"scss/main.min.b28b1ec8b3eb3938701c025f40f5401480195fb6cf744f427e2116d27d34ec3d.css","MediaType":"text/css","Data":{"Integrity":"sha256-soseyLPrOThwHAJfQPVAFIAZX7bPdE9CfiEW0n007D0="}}

0 comments on commit a9d3b1d

Please sign in to comment.