diff --git a/assets/hb/modules/blog/scss/_sidebar.scss b/assets/hb/modules/blog/scss/_sidebar.scss new file mode 100644 index 00000000..c297f2ab --- /dev/null +++ b/assets/hb/modules/blog/scss/_sidebar.scss @@ -0,0 +1,30 @@ +@if $hb-blog-sidebar { + .hb-blog-main-container { + @include media-breakpoint-up(lg) { + display: grid; + grid-gap: 1rem; + grid-template-areas: "sidebar main"; + grid-template-columns: 1fr 3fr; + } + + @include media-breakpoint-up(xl) { + grid-template-columns: 1fr 4fr; + } + } + + .hb-blog-sidebar { + grid-area: sidebar; + + @include media-breakpoint-up(lg) { + height: calc(100vh - 80px); + overflow: auto; + position: sticky; + top: 80px; + } + } + + .hb-blog-main { + grid-area: main; + overflow: hidden; + } +} diff --git a/assets/hb/modules/blog/scss/index.scss b/assets/hb/modules/blog/scss/index.scss index 691f9d08..1266ec60 100644 --- a/assets/hb/modules/blog/scss/index.scss +++ b/assets/hb/modules/blog/scss/index.scss @@ -3,4 +3,5 @@ $hb-blog-toc-top: 86px !default; @import "archives"; @import "home"; @import "post"; +@import "sidebar"; @import "terms"; diff --git a/assets/hb/modules/blog/scss/post/_main.scss b/assets/hb/modules/blog/scss/post/_main.scss index 937ef555..ebed0e13 100644 --- a/assets/hb/modules/blog/scss/post/_main.scss +++ b/assets/hb/modules/blog/scss/post/_main.scss @@ -1,5 +1,6 @@ .hb-blog-post { display: grid; + grid-gap: .5rem; grid-template-areas: "intro" "toc" diff --git a/assets/hb/modules/blog/scss/variables.tmpl.scss b/assets/hb/modules/blog/scss/variables.tmpl.scss new file mode 100644 index 00000000..dd37fa9c --- /dev/null +++ b/assets/hb/modules/blog/scss/variables.tmpl.scss @@ -0,0 +1,2 @@ +{{- $hasSidebar := partialCached "hb/modules/blog/functions/has-sidebar" . }} +$hb-blog-sidebar: {{ $hasSidebar }}; diff --git a/layouts/_default/term.html b/layouts/_default/term.html index 68f709a0..4d617445 100644 --- a/layouts/_default/term.html +++ b/layouts/_default/term.html @@ -4,15 +4,22 @@ {{- end -}} {{- define "main" }} - {{ partial "hugopress/functions/render-hooks" (dict "Name" "hb-blog-main-begin" "Page" .) }} - {{ partialCached "hb/modules/blog/term/profile" . . }} -