Skip to content

Commit

Permalink
feat: add the sidebar.position parameter
Browse files Browse the repository at this point in the history
When end, place the sidebar on the right.
  • Loading branch information
razonyang committed Dec 14, 2023
1 parent 42fed95 commit f297775
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions assets/hb/modules/blog/scss/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
@include media-breakpoint-up(lg) {
display: grid;
grid-gap: 1rem;
grid-template-areas: "sidebar main";
grid-template-columns: 2fr minmax(0, 5fr);
grid-template-areas: if($hb-blog-sidebar-position == end, "main sidebar", "sidebar main");
grid-template-columns: if($hb-blog-sidebar-position == end, minmax(0, 5fr) 2fr, 2fr minmax(0, 5fr));
}

@include media-breakpoint-up(xl) {
grid-template-columns: 2fr minmax(0, 7fr);
grid-template-columns: if($hb-blog-sidebar-position == end, minmax(0, 7fr) 2fr, 2fr minmax(0, 7fr));
}
}

Expand Down
1 change: 1 addition & 0 deletions assets/hb/modules/blog/scss/variables.tmpl.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- $hasSidebar := partialCached "hb/modules/blog/functions/has-sidebar" . }}
$hb-blog-sidebar: {{ $hasSidebar }};
$hb-blog-sidebar-position: {{ default "start" site.Params.hb.blog.sidebar.position }};
$hb-blog-home-pinned-posts-pos: '{{ default "" site.Params.hb.blog.home.pinned_posts_position }}';
3 changes: 3 additions & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ paginate = 30
[params.hb.blog.home]
pinned_posts_position = ""
# taxonomies_style = 'toggle'

[params.hb.blog.sidebar]
position = "start"

0 comments on commit f297775

Please sign in to comment.