Make docs page responsive
Browse files
docs/src/components/DocsHeader.astro
CHANGED
@@ -4,17 +4,10 @@ import { getFormattedStars } from "../lib/github";
|
|
4 |
const starCount = await getFormattedStars('kamranahmedse/driver.js');
|
5 |
---
|
6 |
<div class="border-b flex items-center justify-between" docs-header>
|
7 |
-
<div class="w-[300px] text-right flex justify-end">
|
8 |
-
|
9 |
-
<img src="/driver-head.svg" alt="Astro" class="w-8 h-8 mr-2" />
|
10 |
-
<span class="text-xl font-bold">driver.js</span>
|
11 |
-
</a>
|
12 |
</div>
|
13 |
<div class="flex items-center pr-12">
|
14 |
-
|
15 |
-
class="text-black font-medium hover:border-gray-300 hover:bg-gray-50 text-sm flex items-center border rounded-md py-1.5 px-2">
|
16 |
-
<img src="/star.svg" class="mr-1" />
|
17 |
-
{starCount} GitHub Stars
|
18 |
-
</a>
|
19 |
</div>
|
20 |
</div>
|
|
|
4 |
const starCount = await getFormattedStars('kamranahmedse/driver.js');
|
5 |
---
|
6 |
<div class="border-b flex items-center justify-between" docs-header>
|
7 |
+
<div class="w-[200px] lg:w-[300px] text-right flex justify-end">
|
8 |
+
|
|
|
|
|
|
|
9 |
</div>
|
10 |
<div class="flex items-center pr-12">
|
11 |
+
|
|
|
|
|
|
|
|
|
12 |
</div>
|
13 |
</div>
|
docs/src/components/Sidebar.astro
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
---
|
2 |
import { getCollection, getEntry } from "astro:content";
|
|
|
3 |
|
4 |
export interface Props {
|
5 |
activePath: string;
|
@@ -16,9 +17,17 @@ const groupedGuides = sortedGuides.reduce((acc, curr) => {
|
|
16 |
}, {});
|
17 |
|
18 |
const { activePath } = Astro.props;
|
|
|
|
|
19 |
---
|
20 |
-
<div class="w-[
|
21 |
-
<div class="sticky top-
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
{Object.keys(groupedGuides).map(groupTitle => {
|
23 |
const guides = groupedGuides[groupTitle];
|
24 |
|
|
|
1 |
---
|
2 |
import { getCollection, getEntry } from "astro:content";
|
3 |
+
import { getFormattedStars } from "../lib/github";
|
4 |
|
5 |
export interface Props {
|
6 |
activePath: string;
|
|
|
17 |
}, {});
|
18 |
|
19 |
const { activePath } = Astro.props;
|
20 |
+
|
21 |
+
const starCount = getFormattedStars("kamranahmedse/driver.js");
|
22 |
---
|
23 |
+
<div class="hidden md:block w-[200px] lg:w-[350px] border-r border-gray-200 text-right min-h-screen flex-shrink-0">
|
24 |
+
<div class="sticky top-0">
|
25 |
+
<div class="justify-end flex pt-10 pb-5 px-5">
|
26 |
+
<a href="/" class="block items-center justify-end mb-2">
|
27 |
+
<img src="/driver-head.svg" alt="Astro" class="w-16 h-16" />
|
28 |
+
</a>
|
29 |
+
</div>
|
30 |
+
|
31 |
{Object.keys(groupedGuides).map(groupTitle => {
|
32 |
const guides = groupedGuides[groupTitle];
|
33 |
|
docs/src/layouts/DocsLayout.astro
CHANGED
@@ -17,15 +17,11 @@ const { groupTitle, sort, title } = guide.data;
|
|
17 |
---
|
18 |
|
19 |
<BaseLayout title={title}>
|
20 |
-
<DocsHeader />
|
21 |
<div class="flex">
|
22 |
-
<Sidebar
|
23 |
-
<div
|
24 |
-
|
25 |
-
|
26 |
-
<slot />
|
27 |
-
</div>
|
28 |
-
</Container>
|
29 |
</div>
|
30 |
</div>
|
31 |
</BaseLayout>
|
|
|
17 |
---
|
18 |
|
19 |
<BaseLayout title={title}>
|
|
|
20 |
<div class="flex">
|
21 |
+
<Sidebar />
|
22 |
+
<div
|
23 |
+
class="min-w-0 max-w-[800px] py-10 lg:py-12 prose px-14 lg:proxe-xl mb-24 prose-blockquote:font-normal prose-blockquote:not-italic prose-blockquote:text-gray-500 prose-p:before:content-['']">
|
24 |
+
<slot />
|
|
|
|
|
|
|
25 |
</div>
|
26 |
</div>
|
27 |
</BaseLayout>
|