Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add the sidebar.position parameter #545

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 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,22 @@
@include media-breakpoint-up(lg) {
display: grid;
grid-gap: 1rem;
grid-template-areas: "sidebar main";
grid-template-columns: 2fr minmax(0, 5fr);

@if $hb-blog-sidebar-position == end {
grid-template-areas: "main sidebar";
grid-template-columns: minmax(0, 5fr) 2fr;
} @else {
grid-template-areas: "sidebar main";
grid-template-columns: 2fr minmax(0, 5fr);
}
}

@include media-breakpoint-up(xl) {
grid-template-columns: 2fr minmax(0, 7fr);
@if $hb-blog-sidebar-position == end {
grid-template-columns: minmax(0, 7fr) 2fr;
} @else {
grid-template-columns: 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"