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

[WIP] Bump Docsy to 0.7.x #48725

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fixup resizable sidebar for Docsy 0.7.x
  • Loading branch information
sftim committed Jan 31, 2025
commit 2dd07a560cc7e4ecd8a791d0f3065b0794d0893a
31 changes: 31 additions & 0 deletions assets/scss/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,37 @@ footer {
}
}

/* SPLITTER (resizable sidebar) */
.gutter {
background-color: #eee;
background-repeat: no-repeat;
background-position: 50%;
flex-grow: 0;
padding: 0;
}

.gutter.gutter-horizontal {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
cursor: col-resize;
}

#sidebarnav,
#maindoc {
max-width: 100%;
}

#maindoc {
overflow-wrap: break-word;
}

@media (max-width: 768px) {
#sidebarnav {
padding-left: 15px;
padding-right: 15px;
}

}

/* SIDE-DRAWER MENU */

.pi-pushmenu .sled {
Expand Down
4 changes: 2 additions & 2 deletions layouts/docs/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
<div class="container-fluid td-outer">
<div class="td-main">
<div class="row flex-xl-nowrap">
<div class="col-12 col-md-3 col-xl-2 td-sidebar d-print-none{{ if .Site.Params.ui.sidebar_resizable }} split{{ end }}">
<div id="nav-sidebar" class="col-12 col-md-3 col-xl-2 td-sidebar d-print-none{{ if .Site.Params.ui.sidebar_resizable }} split{{ end }}">
{{ partial "sidebar.html" . }}
</div>
<main class="col-12 col-md-9 col-xl-8 ps-md-5" role="main"
<main class="col-12 col-md-9 col-xl-8 ps-md-5 docs-main-content" role="main"
{{ if ne .Params.cid "docsHome" }}data-pagefind-body{{ end }}{{ if (and .IsPage .Params.description ) }} data-pagefind-meta="description:{{ .Params.description }}"{{ end }}>
<!-- inside main element -->
{{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }}
Expand Down
5 changes: 3 additions & 2 deletions layouts/partials/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@
function enableSplitter(mediaQuery) {
if (mediaQuery.matches) {
if (!splitInstance) {
splitInstance = Split(["#sidebarnav", "#maindoc"], {
splitInstance = Split(["#nav-sidebar", ".docs-main-content"], {
sizes: [20, 80],
minSize: 100,
gutterSize: 8 // pixels
});
}
} else {
Expand All @@ -61,7 +62,7 @@

const screenWidthMediaQuery = window.matchMedia("(min-width: 768px)");

const eleNav = document.getElementById("sidebarnav");
const eleNav = document.getElementById("nav-sidebar");
if (eleNav !== null) {
enableSplitter(screenWidthMediaQuery);
screenWidthMediaQuery.addListener(enableSplitter);
Expand Down