Skip to content

Commit

Permalink
Learning hub sidebar mobile (#1215)
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisjofrank authored Nov 29, 2024
1 parent 275215c commit 5c23195
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
10 changes: 7 additions & 3 deletions _includes/raw_with_sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,15 @@ export default function Page(props: Lume.Data, helpers: Lume.Helpers) {
props.toc = toc.concat(...props.toc);
}

let isLearnHub = props.url.includes("learn");
const checkIsHub = /^\/learn\/$/;
const isLearnHub = checkIsHub.test(props.url);

return (
<>
<aside
class="flex flex-col absolute top-0 xl:top-16 bottom-0 -translate-x-74 xl:left-0 sidebar-open:translate-x-0 w-74 border-r border-foreground-tertiary bg-background-primary z-50 xl:z-0 xl:translate-x-0 transition-transform"
className={`flex flex-col absolute top-0 xl:top-16 bottom-0 -translate-x-74 xl:left-0 sidebar-open:translate-x-0 w-74 border-r border-foreground-tertiary bg-background-primary z-50 xl:z-0 xl:translate-x-0 transition-transform ${
isLearnHub && "xl:hidden"
}`}
id="sidebar"
data-open="false"
>
Expand Down Expand Up @@ -108,7 +111,8 @@ export default function Page(props: Lume.Data, helpers: Lume.Helpers) {
style={{ scrollbarGutter: "stable" }}
>
{props.children}
<div class="xl:col-span-full">
{props.comp.Feedback({ file })}
<div class="xl:col-span-full mt-4">
<props.comp.Footer />
</div>
</div>
Expand Down
26 changes: 26 additions & 0 deletions learn/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
import LandingPage from "./_pages/LandingPage.tsx";

export const layout = "raw.tsx";
export const sidebar = [
{
items: [
{
label: "Runtime",
id: "/runtime/",
},
{
label: "API Reference",
id: "/api/deno/",
},
{
label: "Examples",
id: "/examples/",
},
{
label: "Deploy",
id: "/Deploy/",
},
{
label: "Subhosting",
id: "/Subhosting/",
},
],
},
];

export const toc = [];

Expand Down

0 comments on commit 5c23195

Please sign in to comment.