www: rework docs layout (#2429)
- Re-enable partials - clean up layout a bit
This commit is contained in:
Vendored
+2
-2
@@ -6,8 +6,8 @@
|
||||
"$fresh/": "../",
|
||||
"twind": "https://esm.sh/twind@0.16.19",
|
||||
"twind/": "https://esm.sh/twind@0.16.19/",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.2.2",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.5.1",
|
||||
"@preact/signals-core@1.2.3": "https://esm.sh/@preact/signals-core@1.2.3",
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@
|
||||
},
|
||||
"imports": {
|
||||
"$fresh/": "../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.2.2",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.5.1"
|
||||
},
|
||||
|
||||
@@ -83,8 +83,8 @@ export default {
|
||||
+ "nodeModulesDir": true,
|
||||
"imports": {
|
||||
"$fresh/": "https://deno.land/x/fresh@1.5.2/",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
- "twind": "https://esm.sh/twind@0.16.19",
|
||||
- "twind/": "https://esm.sh/twind@0.16.19/",
|
||||
+ "tailwindcss": "npm:tailwindcss@3.4.1",
|
||||
|
||||
@@ -22,8 +22,8 @@ instead this one particular commit? Just make the following changes to your
|
||||
"imports": {
|
||||
- "$fresh/": "https://deno.land/x/fresh@1.2.0/",
|
||||
+ "$fresh/": "https://raw.githubusercontent.com/denoland/fresh/the-particular-commit-hash-here/",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
```
|
||||
|
||||
### Forked Fresh
|
||||
@@ -39,8 +39,8 @@ been merged yet (at the time of writing this):
|
||||
"imports": {
|
||||
- "$fresh/": "https://deno.land/x/fresh@1.2.0/",
|
||||
+ "$fresh/": "https://raw.githubusercontent.com/deer/fresh/state_in_props/",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
```
|
||||
|
||||
## Creating a new project
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
export const RECOMMENDED_PREACT_VERSION = "10.19.6";
|
||||
export const RECOMMENDED_PREACT_VERSION = "10.22.0";
|
||||
export const RECOMMENDED_PREACT_SIGNALS_VERSION = "1.2.2";
|
||||
export const RECOMMENDED_PREACT_SIGNALS_CORE_VERSION = "1.5.1";
|
||||
export const RECOMMENDED_TWIND_CORE_VERSION = "1.1.3";
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.5",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.3.1"
|
||||
},
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
},
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.2.2",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.5.0",
|
||||
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.1.0",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"tailwindcss": "npm:tailwindcss@3.4.1"
|
||||
},
|
||||
"compilerOptions": {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"tailwindcss": "npm:tailwindcss@3.4.1"
|
||||
},
|
||||
"compilerOptions": {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.2.3"
|
||||
},
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.0",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.2.3"
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.0",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.2.3"
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.0",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.2.3"
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.2.3"
|
||||
},
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.0",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.2.3"
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.0",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.2.3"
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.0",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.2.3"
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/"
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/"
|
||||
},
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/"
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/"
|
||||
},
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.1"
|
||||
},
|
||||
"compilerOptions": {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.1",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.5",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.3.1"
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/"
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/"
|
||||
},
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
},
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.2.3"
|
||||
},
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
// islands/Dropdown.tsx
|
||||
import { ComponentChildren, createContext } from "preact";
|
||||
import { StateUpdater, useState } from "preact/hooks";
|
||||
import { useState } from "preact/hooks";
|
||||
|
||||
const DropdownContext = createContext<[boolean, StateUpdater<boolean>]>(
|
||||
[false, () => {}],
|
||||
const DropdownContext = createContext<[boolean, (prev: boolean) => boolean]>(
|
||||
[false, () => false],
|
||||
);
|
||||
|
||||
export default function Dropdown(
|
||||
{ children }: { children: ComponentChildren },
|
||||
) {
|
||||
return (
|
||||
<DropdownContext.Provider value={useState(false)}>
|
||||
// deno-lint-ignore no-explicit-any
|
||||
<DropdownContext.Provider value={useState(false) as any}>
|
||||
{children}
|
||||
</DropdownContext.Provider>
|
||||
);
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.2.2",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.5.0"
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/"
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
},
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/"
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.2.3"
|
||||
},
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
"$fresh/": "../../",
|
||||
"twind": "https://esm.sh/twind@0.16.19",
|
||||
"twind/": "https://esm.sh/twind@0.16.19/",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.1.0",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.2.3"
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/"
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/"
|
||||
},
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.1",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.2.3",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/"
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/"
|
||||
},
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.1"
|
||||
},
|
||||
"compilerOptions": {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/"
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/"
|
||||
},
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.1"
|
||||
},
|
||||
"compilerOptions": {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
},
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.1"
|
||||
},
|
||||
"compilerOptions": {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/"
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/"
|
||||
},
|
||||
"compilerOptions": {
|
||||
"jsx": "react-jsx",
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
},
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
|
||||
"@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.2.3",
|
||||
"$std/": "https://deno.land/std@0.211.0/"
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.1",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.5",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.3.1"
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
"$fresh/": "../../",
|
||||
"twind": "https://esm.sh/twind@0.16.19",
|
||||
"twind/": "https://esm.sh/twind@0.16.19/",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.2.3"
|
||||
},
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.1"
|
||||
},
|
||||
"compilerOptions": {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"tailwindcss": "npm:tailwindcss@3.4.1"
|
||||
},
|
||||
"compilerOptions": {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"tailwindcss": "npm:tailwindcss@3.4.1"
|
||||
},
|
||||
"compilerOptions": {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"tailwindcss": "npm:tailwindcss@3.4.1"
|
||||
},
|
||||
"compilerOptions": {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"lock": false,
|
||||
"imports": {
|
||||
"$fresh/": "../../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"tailwindcss": "npm:tailwindcss@3.4.1"
|
||||
},
|
||||
"compilerOptions": {
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
"$fresh/": "../../",
|
||||
"twind": "https://esm.sh/twind@0.16.19",
|
||||
"twind/": "https://esm.sh/twind@0.16.19/",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.1.3",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.2.3"
|
||||
},
|
||||
|
||||
@@ -1,49 +1,7 @@
|
||||
import {
|
||||
CATEGORIES,
|
||||
TableOfContentsCategory,
|
||||
TableOfContentsCategoryEntry,
|
||||
} from "../data/docs.ts";
|
||||
import SearchButton from "../islands/SearchButton.tsx";
|
||||
import VersionSelect from "../islands/VersionSelect.tsx";
|
||||
import { type VersionLink } from "../routes/docs/[...slug].tsx";
|
||||
import { Logo } from "$fresh/www/components/Header.tsx";
|
||||
import DocsTitle from "$fresh/www/components/DocsTitle.tsx";
|
||||
|
||||
export default function DocsSidebar(
|
||||
props: {
|
||||
mobile?: boolean;
|
||||
versionLinks: VersionLink[];
|
||||
selectedVersion: string;
|
||||
},
|
||||
) {
|
||||
return (
|
||||
<>
|
||||
<div class="fixed w-[17rem] md:flex h-screen overflow-hidden ">
|
||||
<div class="flex-1 h-screen overflow-y-auto">
|
||||
<div class="sticky mb-4 top-0 bg-white z-10">
|
||||
<div class=" py-4 flex items-center">
|
||||
<Logo />
|
||||
<DocsTitle />
|
||||
</div>
|
||||
<hr />
|
||||
</div>
|
||||
<SearchButton class="mr-4 sm:mr-0" />
|
||||
<div class="mb-4">
|
||||
<VersionSelect
|
||||
selectedVersion={props.selectedVersion}
|
||||
versions={props.versionLinks}
|
||||
/>
|
||||
</div>
|
||||
<ul class="list-inside font-semibold nested ml-2.5">
|
||||
{CATEGORIES[props.selectedVersion].map((category) => (
|
||||
<SidebarCategory key={category.href} category={category} />
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export function SidebarCategory(props: {
|
||||
category: TableOfContentsCategory;
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
export default function DocsTitle() {
|
||||
return (
|
||||
<>
|
||||
<a
|
||||
href="/"
|
||||
class="text-2xl text-gray-900 flex items-center"
|
||||
aria-label="Top Page"
|
||||
>
|
||||
<svg
|
||||
preserveAspectRatio="xMinYMin"
|
||||
viewBox="0 0 250 75"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-5 inline-block"
|
||||
aria-label="Fresh logo"
|
||||
>
|
||||
<path
|
||||
d="M14.0805 0.761269V70.0893H0V0.761269H14.0805ZM35.6322 30.2257V41.7803H10.3448V30.2257H35.6322ZM38.5057 0.761269V12.3159H10.3448V0.761269H38.5057ZM46.5517 0.761269H68.9655C73.5632 0.761269 77.5862 1.62785 80.7471 3.36105C83.908 4.80538 86.4943 7.11632 88.2184 10.2939C90.1641 13.8269 91.1548 17.8107 91.092 21.8485C91.092 25.6038 90.5172 28.7813 89.3678 31.3811C88.5057 34.2698 87.069 36.2919 85.0575 38.0251C83.046 39.7583 81.0345 40.9137 78.4483 42.3581L74.1379 44.669H56.0345V33.1143H68.3908C70.0971 33.2247 71.7975 32.8225 73.2759 31.9589C74.4253 31.0923 75.2874 29.9368 76.1494 28.4925C76.8253 26.6458 77.1186 24.6798 77.0115 22.7151C77.0115 20.6931 76.7241 18.9599 76.1494 17.2267C75.5747 15.7823 74.7126 14.338 73.2759 13.7603C72.4138 12.8937 70.6897 12.3159 68.9655 12.3159H60.3448V70.0893H46.5517V0.761269V0.761269ZM78.1609 70.0893L65.5172 39.1805H79.8851L93.1035 69.5115V70.0893H78.1609ZM140.517 58.5346V70.0893H110.345V58.5346H140.517ZM114.655 0.761269V70.0893H100.575V0.761269H114.943H114.655ZM136.494 29.0702V40.0471H110.345V29.0702H136.207H136.494ZM140.517 0.761269V12.3159H110.345V0.761269H140.517ZM178.161 51.8907C178.161 50.7352 178.161 49.5797 177.586 48.7131C177.586 47.5577 177.012 46.6911 176.149 45.8245L173.276 42.9358L167.816 40.6249L160.345 37.1585L154.023 32.8255C152.021 31.2537 150.359 29.2878 149.138 27.0481C148.066 24.5949 147.574 21.9252 147.701 19.2487C147.701 16.3601 147.989 13.4714 149.138 11.4493C150.166 9.00506 151.739 6.83084 153.736 5.09427C155.747 3.64994 158.046 2.20559 160.632 1.33899C167.362 -0.855543 174.677 -0.337717 181.034 2.78333C184.483 4.51653 186.782 7.11632 188.793 10.2939C190.517 13.1825 191.667 17.2267 191.667 21.2708H177.299C177.424 19.5169 177.229 17.7548 176.724 16.0712C176.149 14.6269 175.287 13.1825 173.851 12.6048C172.701 11.7382 170.977 11.1605 169.253 11.1605C167.529 11.1605 166.092 11.7382 164.943 12.3159C163.793 12.8937 162.931 14.0491 162.069 15.2046L161.494 19.2487C161.494 20.4042 161.782 21.5597 162.356 22.4263L164.655 24.7372C167.235 26.2818 169.924 27.6335 172.701 28.7813L181.034 32.8255C183.199 34.2594 185.136 36.0121 186.782 38.0251C188.793 39.7583 189.655 41.7803 190.805 43.8024C192.605 48.9619 192.503 54.5998 190.517 59.6901C189.368 62.001 187.931 64.0231 186.207 65.7563C184.115 67.5878 181.669 68.9647 179.023 69.8004C173.276 71.2447 176.149 75 170.402 75C164.655 75 166.667 70.667 161.207 69.8004C158.333 68.9338 155.46 67.4895 153.448 65.7563C151.19 63.7856 149.419 61.313 148.276 58.5346C147.126 55.6459 146.552 52.1795 146.552 48.4243H160.632C160.632 50.4463 160.632 52.1795 161.207 53.6239C161.494 55.0682 162.069 56.5125 162.931 57.3791C163.793 57.9569 164.943 58.8235 166.092 59.1123C167.529 59.6901 168.966 59.6901 170.402 59.6901C172.414 59.6901 173.851 59.6901 175 58.8235C176.149 57.9569 176.724 57.0903 177.299 55.9348C177.874 54.7793 178.161 53.335 178.161 51.8907V51.8907ZM239.943 28.7813V40.336H211.207V28.7813H239.943ZM215.23 0.761269V70.0893H201.437V0.761269H215.23ZM250 0.761269V70.0893H236.207V0.761269H250Z"
|
||||
fill="#0A140C"
|
||||
/>
|
||||
</svg>
|
||||
</a>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
import PropsDemo from "$fresh/tests/fixture_partials/routes/island_props_signals/index.tsx";
|
||||
import * as Icons from "./Icons.tsx";
|
||||
import { JSX } from "preact";
|
||||
|
||||
const LINKS = [
|
||||
|
||||
+30
-33
@@ -1,4 +1,3 @@
|
||||
import DocsTitle from "./DocsTitle.tsx";
|
||||
import NavigationBar from "./NavigationBar.tsx";
|
||||
|
||||
export default function Header(props: { title: string; active: string }) {
|
||||
@@ -6,38 +5,23 @@ export default function Header(props: { title: string; active: string }) {
|
||||
const isDocs = props.active == "/docs";
|
||||
|
||||
return (
|
||||
<>
|
||||
{isDocs
|
||||
? (
|
||||
<header
|
||||
class={" top-0 w-full bg-transparent mx-auto max-w-screen-xl flex gap-3 items-center " +
|
||||
"justify-between md:justify-end"}
|
||||
f-client-nav={false}
|
||||
>
|
||||
<div class="p-4 flex items-center md:hidden">
|
||||
<Logo />
|
||||
<DocsTitle />
|
||||
</div>
|
||||
|
||||
<NavigationBar class="" active={props.active} />
|
||||
</header>
|
||||
)
|
||||
: (
|
||||
<header
|
||||
class={"h-20 mx-auto max-w-screen-xl flex gap-3 items-center " +
|
||||
(isHome ? "justify-end" : "justify-between")}
|
||||
f-client-nav={false}
|
||||
>
|
||||
{!isHome && (
|
||||
<div class="p-4 flex items-center">
|
||||
<Logo />
|
||||
<DocsTitle />
|
||||
</div>
|
||||
)}
|
||||
<NavigationBar class="" active={props.active} />
|
||||
</header>
|
||||
)}
|
||||
</>
|
||||
<header
|
||||
class={[
|
||||
"mx-auto flex gap-3 items-center",
|
||||
isHome ? "justify-end" : "justify-between",
|
||||
isDocs
|
||||
? "h-20 max-w-screen-2xl w-full sticky top-0 bg-white/75 z-50 backdrop-blur-sm"
|
||||
: "h-20 max-w-screen-xl",
|
||||
].join(" ")}
|
||||
f-client-nav={false}
|
||||
>
|
||||
{!isHome && (
|
||||
<div class="p-4 flex items-center">
|
||||
<Logo />
|
||||
</div>
|
||||
)}
|
||||
<NavigationBar class="" active={props.active} />
|
||||
</header>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -45,6 +29,19 @@ export function Logo() {
|
||||
return (
|
||||
<a href="/" class="flex mr-3 items-center" aria-label="Top Page">
|
||||
<img src="/logo.svg" alt="Fresh logo" width={40} height={40} />
|
||||
<svg
|
||||
preserveAspectRatio="xMinYMin"
|
||||
viewBox="0 0 250 75"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-5 inline-block ml-2.5"
|
||||
aria-label="Fresh logo"
|
||||
>
|
||||
<path
|
||||
d="M14.0805 0.761269V70.0893H0V0.761269H14.0805ZM35.6322 30.2257V41.7803H10.3448V30.2257H35.6322ZM38.5057 0.761269V12.3159H10.3448V0.761269H38.5057ZM46.5517 0.761269H68.9655C73.5632 0.761269 77.5862 1.62785 80.7471 3.36105C83.908 4.80538 86.4943 7.11632 88.2184 10.2939C90.1641 13.8269 91.1548 17.8107 91.092 21.8485C91.092 25.6038 90.5172 28.7813 89.3678 31.3811C88.5057 34.2698 87.069 36.2919 85.0575 38.0251C83.046 39.7583 81.0345 40.9137 78.4483 42.3581L74.1379 44.669H56.0345V33.1143H68.3908C70.0971 33.2247 71.7975 32.8225 73.2759 31.9589C74.4253 31.0923 75.2874 29.9368 76.1494 28.4925C76.8253 26.6458 77.1186 24.6798 77.0115 22.7151C77.0115 20.6931 76.7241 18.9599 76.1494 17.2267C75.5747 15.7823 74.7126 14.338 73.2759 13.7603C72.4138 12.8937 70.6897 12.3159 68.9655 12.3159H60.3448V70.0893H46.5517V0.761269V0.761269ZM78.1609 70.0893L65.5172 39.1805H79.8851L93.1035 69.5115V70.0893H78.1609ZM140.517 58.5346V70.0893H110.345V58.5346H140.517ZM114.655 0.761269V70.0893H100.575V0.761269H114.943H114.655ZM136.494 29.0702V40.0471H110.345V29.0702H136.207H136.494ZM140.517 0.761269V12.3159H110.345V0.761269H140.517ZM178.161 51.8907C178.161 50.7352 178.161 49.5797 177.586 48.7131C177.586 47.5577 177.012 46.6911 176.149 45.8245L173.276 42.9358L167.816 40.6249L160.345 37.1585L154.023 32.8255C152.021 31.2537 150.359 29.2878 149.138 27.0481C148.066 24.5949 147.574 21.9252 147.701 19.2487C147.701 16.3601 147.989 13.4714 149.138 11.4493C150.166 9.00506 151.739 6.83084 153.736 5.09427C155.747 3.64994 158.046 2.20559 160.632 1.33899C167.362 -0.855543 174.677 -0.337717 181.034 2.78333C184.483 4.51653 186.782 7.11632 188.793 10.2939C190.517 13.1825 191.667 17.2267 191.667 21.2708H177.299C177.424 19.5169 177.229 17.7548 176.724 16.0712C176.149 14.6269 175.287 13.1825 173.851 12.6048C172.701 11.7382 170.977 11.1605 169.253 11.1605C167.529 11.1605 166.092 11.7382 164.943 12.3159C163.793 12.8937 162.931 14.0491 162.069 15.2046L161.494 19.2487C161.494 20.4042 161.782 21.5597 162.356 22.4263L164.655 24.7372C167.235 26.2818 169.924 27.6335 172.701 28.7813L181.034 32.8255C183.199 34.2594 185.136 36.0121 186.782 38.0251C188.793 39.7583 189.655 41.7803 190.805 43.8024C192.605 48.9619 192.503 54.5998 190.517 59.6901C189.368 62.001 187.931 64.0231 186.207 65.7563C184.115 67.5878 181.669 68.9647 179.023 69.8004C173.276 71.2447 176.149 75 170.402 75C164.655 75 166.667 70.667 161.207 69.8004C158.333 68.9338 155.46 67.4895 153.448 65.7563C151.19 63.7856 149.419 61.313 148.276 58.5346C147.126 55.6459 146.552 52.1795 146.552 48.4243H160.632C160.632 50.4463 160.632 52.1795 161.207 53.6239C161.494 55.0682 162.069 56.5125 162.931 57.3791C163.793 57.9569 164.943 58.8235 166.092 59.1123C167.529 59.6901 168.966 59.6901 170.402 59.6901C172.414 59.6901 173.851 59.6901 175 58.8235C176.149 57.9569 176.724 57.0903 177.299 55.9348C177.874 54.7793 178.161 53.335 178.161 51.8907V51.8907ZM239.943 28.7813V40.336H211.207V28.7813H239.943ZM215.23 0.761269V70.0893H201.437V0.761269H215.23ZM250 0.761269V70.0893H236.207V0.761269H250Z"
|
||||
fill="#0A140C"
|
||||
/>
|
||||
</svg>
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
||||
+2
-2
@@ -8,8 +8,8 @@
|
||||
},
|
||||
"imports": {
|
||||
"$fresh/": "../",
|
||||
"preact": "https://esm.sh/preact@10.19.6",
|
||||
"preact/": "https://esm.sh/preact@10.19.6/",
|
||||
"preact": "https://esm.sh/preact@10.22.0",
|
||||
"preact/": "https://esm.sh/preact@10.22.0/",
|
||||
"@preact/signals": "https://esm.sh/*@preact/signals@1.2.2",
|
||||
"@preact/signals-core": "https://esm.sh/@preact/signals-core@1.5.1",
|
||||
"$prism": "https://esm.sh/prismjs@1.29.0",
|
||||
|
||||
@@ -136,7 +136,7 @@ export function TableOfContents({ headings }: TableOfContentsProps) {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div class="hidden xl:block xl:sticky top-16">
|
||||
<div class="hidden xl:block xl:sticky xl:top-40">
|
||||
<div class="relative">
|
||||
<div
|
||||
ref={refMarker}
|
||||
|
||||
+106
-84
@@ -1,9 +1,10 @@
|
||||
import { Handlers, PageProps } from "$fresh/server.ts";
|
||||
import { asset, Head, Partial } from "$fresh/runtime.ts";
|
||||
import DocsSidebar from "../../components/DocsSidebar.tsx";
|
||||
import { SidebarCategory } from "../../components/DocsSidebar.tsx";
|
||||
import Footer from "../../components/Footer.tsx";
|
||||
import Header from "../../components/Header.tsx";
|
||||
import {
|
||||
CATEGORIES,
|
||||
getFirstPageUrl,
|
||||
LATEST_VERSION,
|
||||
TABLE_OF_CONTENTS,
|
||||
@@ -12,6 +13,8 @@ import {
|
||||
import { frontMatter, renderMarkdown } from "../../utils/markdown.ts";
|
||||
import toc from "../../../docs/toc.ts";
|
||||
import { TableOfContents } from "../../islands/TableOfContents.tsx";
|
||||
import SearchButton from "$fresh/www/islands/SearchButton.tsx";
|
||||
import VersionSelect from "$fresh/www/islands/VersionSelect.tsx";
|
||||
|
||||
interface Data {
|
||||
page: Page;
|
||||
@@ -159,111 +162,130 @@ export default function DocsPage(props: PageProps<Data>) {
|
||||
<meta name="view-transition" content="same-origin" />
|
||||
</Head>
|
||||
<div class="flex flex-col min-h-screen mx-auto max-w-screen-2xl">
|
||||
{/* Disable partial navigation until this bug in Preact is fixed https://github.com/preactjs/preact/pull/4287 */}
|
||||
<div class="flex-1 " f-client-nav={false}>
|
||||
<div class=" md:flex">
|
||||
<nav class="w-[18rem] flex-shrink-0 hidden md:block px-4">
|
||||
<DocsSidebar
|
||||
versionLinks={page.versionLinks}
|
||||
selectedVersion={page.version}
|
||||
/>
|
||||
</nav>
|
||||
<Partial name="docs-main">
|
||||
<div class="w-full min-w-0">
|
||||
<Header title="docs" active="/docs" />
|
||||
<main class="mt-4 min-w-0 mx-auto">
|
||||
<MobileSidebar page={page} />
|
||||
<div class="flex mx-auto max-w-screen-2xl px-4 md:px-0 md:py-0 justify-end bg-gray-100">
|
||||
<label
|
||||
for="docs_sidebar"
|
||||
class="px-4 py-3 md:hidden flex items-center hover:bg-gray-100 rounded gap-2 cursor-pointer"
|
||||
>
|
||||
<svg
|
||||
class="h-6 w-6"
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="2"
|
||||
d="M4 6h16M4 12h16M4 18h7"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
<div>Table of Contents</div>
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex gap-6 md:gap-8 xl:gap-[8%] flex-col xl:flex-row md:mx-8 lg:mx-16 2xl:mx-0 lg:justify-end">
|
||||
<TableOfContents headings={headings} />
|
||||
<Header title="docs" active="/docs" />
|
||||
<div f-client-nav={true}>
|
||||
<MobileSidebar page={page} />
|
||||
<div class="flex mx-auto max-w-screen-2xl px-4 md:px-0 md:py-0 justify-end bg-gray-100">
|
||||
<label
|
||||
for="docs_sidebar"
|
||||
class="px-4 py-3 lg:hidden flex items-center hover:bg-gray-100 rounded gap-2 cursor-pointer"
|
||||
>
|
||||
<svg
|
||||
class="h-6 w-6"
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="2"
|
||||
d="M4 6h16M4 12h16M4 18h7"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
<div>Table of Contents</div>
|
||||
</label>
|
||||
</div>
|
||||
<nav class="flex-shrink-0 hidden lg:block lg:px-4 bg-white">
|
||||
<div class="fixed top-24 w-[17rem] flex overflow-hidden">
|
||||
<div class="flex-1 h-[calc(100vh_-_6rem)] overflow-y-auto pb-8">
|
||||
<SearchButton class="mr-4 sm:mr-0" />
|
||||
<div class="mb-4">
|
||||
<VersionSelect
|
||||
selectedVersion={page.version}
|
||||
versions={page.versionLinks}
|
||||
/>
|
||||
</div>
|
||||
<ul class="list-inside font-semibold nested ml-2.5">
|
||||
{CATEGORIES[page.version].map((category) => (
|
||||
<SidebarCategory key={category.href} category={category} />
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<Partial name="docs-main">
|
||||
<div class="w-full min-w-0">
|
||||
<main class="lg:ml-[18rem] mt-4 min-w-0 mx-auto">
|
||||
<div class="flex gap-6 md:gap-8 xl:gap-[8%] flex-col xl:flex-row md:mx-8 lg:mx-16 2xl:mx-0 lg:justify-end">
|
||||
<TableOfContents headings={headings} />
|
||||
|
||||
<div class="lg:order-1 min-w-0 max-w-3xl w-full">
|
||||
<h1 class="text-4xl text-gray-900 tracking-tight font-bold md:mt-0 px-4 md:px-0 mb-4">
|
||||
{page.title}
|
||||
</h1>
|
||||
<div
|
||||
class="markdown-body mb-8"
|
||||
dangerouslySetInnerHTML={{ __html: html }}
|
||||
<div class="lg:order-1 min-w-0 max-w-3xl w-full">
|
||||
<h1 class="text-4xl text-gray-900 tracking-tight font-bold md:mt-0 px-4 md:px-0 mb-4">
|
||||
{page.title}
|
||||
</h1>
|
||||
<div
|
||||
class="markdown-body mb-8"
|
||||
dangerouslySetInnerHTML={{ __html: html }}
|
||||
/>
|
||||
|
||||
<div class="mb-8">
|
||||
<ForwardBackButtons
|
||||
slug={page.slug}
|
||||
version={page.version}
|
||||
prev={page.prevNav}
|
||||
next={page.nextNav}
|
||||
/>
|
||||
|
||||
<div class="mb-8">
|
||||
<ForwardBackButtons
|
||||
slug={page.slug}
|
||||
version={page.version}
|
||||
prev={page.prevNav}
|
||||
next={page.nextNav}
|
||||
/>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="px-4 md:px-0 flex justify-between my-6">
|
||||
<a
|
||||
href={`https://github.com/denoland/fresh/edit/main/${page.file}`}
|
||||
class="text-green-600 underline flex items-center"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<svg class="w-4 h-4 inline-block mr-1">
|
||||
<use href="/icons.svg#external" />
|
||||
</svg>
|
||||
Edit this page on GitHub
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="px-4 md:px-0 flex justify-between my-6">
|
||||
<a
|
||||
href={`https://github.com/denoland/fresh/edit/main/${page.file}`}
|
||||
class="text-green-600 underline flex items-center"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<svg class="w-4 h-4 inline-block mr-1">
|
||||
<use href="/icons.svg#external" />
|
||||
</svg>
|
||||
Edit this page on GitHub
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="xl:ml-[3.75rem]">
|
||||
<Footer />
|
||||
</main>
|
||||
</div>
|
||||
</Partial>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</Partial>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function MobileSidebar(props: { page: Page }) {
|
||||
function MobileSidebar({ page }: { page: Page }) {
|
||||
return (
|
||||
<div class="md:hidden">
|
||||
<div class="lg:hidden">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="hidden toggle"
|
||||
id="docs_sidebar"
|
||||
autocomplete="off"
|
||||
>
|
||||
</input>
|
||||
<div class="fixed inset-0 flex z-40 hidden toggled">
|
||||
/>
|
||||
<div class="fixed inset-0 flex z-50 hidden toggled">
|
||||
<label
|
||||
class="absolute inset-0 bg-gray-600 opacity-75"
|
||||
for="docs_sidebar"
|
||||
/>
|
||||
<div class="relative flex-1 flex flex-col w-[18rem] h-full bg-white border-r-2 border-gray-100">
|
||||
<nav class="pt-0 pb-16 px-4 overflow-x-auto">
|
||||
<DocsSidebar
|
||||
mobile
|
||||
versionLinks={props.page.versionLinks}
|
||||
selectedVersion={props.page.version}
|
||||
/>
|
||||
<nav class="pt-0 pb-16 overflow-x-auto">
|
||||
<div class="flex-1 h-screen overflow-y-auto pt-4 px-4">
|
||||
<SearchButton class="mr-4 sm:mr-0" />
|
||||
<div class="mb-4">
|
||||
<VersionSelect
|
||||
selectedVersion={page.version}
|
||||
versions={page.versionLinks}
|
||||
/>
|
||||
</div>
|
||||
<ul class="list-inside font-semibold nested ml-2.5">
|
||||
{CATEGORIES[page.version].map((category) => (
|
||||
<SidebarCategory key={category.href} category={category} />
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user