Skip to content

Commit 7162ce7

Browse files
authored
Merge branch 'main' into feat/example-sveltekit
2 parents 85da1a2 + 54e5f8a commit 7162ce7

File tree

276 files changed

+8117
-2062
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

276 files changed

+8117
-2062
lines changed

.github/workflows/update_versions.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ cliCommandsReferenceFile.writeJsonPrettySync(
3232
JSON.parse(new TextDecoder().decode(jsonReference.outputSync().stdout)),
3333
);
3434

35+
await $`deno task update_lint_rules`;
36+
3537
if (Deno.args.includes("--create-pr")) {
3638
await tryCreatePr();
3739
}

404.tsx

Lines changed: 0 additions & 54 deletions
This file was deleted.

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,40 @@ deno task prod
3131
Which will start a Deno server on [localhost:8000](http://localhost:8000) used
3232
in production, which handles redirects.
3333

34+
the above commands will defauilt to performing as complete build of the site
35+
including all of the more expensive operations. You can also perform a lighter
36+
build by running:
37+
38+
```console
39+
deno task build:light
40+
```
41+
42+
This will build the site without generating the Open Graph images and other more
43+
time-consuming operations which might be desirable to skip during local
44+
developement work.
45+
46+
## Developing styles and components
47+
48+
We are increasingly making use of global components to improve consistency and
49+
reduce duplication. A styleguide has been created to preview and develop these
50+
components and is generated during the build process.
51+
52+
You can browse to it in the site at `/styleguide/`
53+
54+
To avoid longer build times of the entire site and all of its content while
55+
developing UI elements and components, a styleguide-only build is avaiable which
56+
performs the initial global configureation for the site, but then only generates
57+
and watches for changes in the `/styleguide` folder of the repo.
58+
59+
To work on just the components and UI elements and review them within
60+
styleguide, run:
61+
62+
```console
63+
deno task serve:style
64+
```
65+
66+
Then browse to the styleguide section of the site at `/styleguide/`
67+
3468
## Editing content
3569

3670
The actual content of the docs site is found mostly in these folders:

_components/Base.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { PageBase, ToCCtx } from "@deno/doc";
2+
3+
export default function Base(
4+
{ data, comp, children }: Lume.Data & { data: PageBase },
5+
_helpers: Lume.Helpers,
6+
) {
7+
return (
8+
<>
9+
<div className="ddoc markdown-body">
10+
<link rel="stylesheet" href="/reference_styles.css" />
11+
<comp.Breadcrumbs parts={data.breadcrumbs_ctx.parts} />
12+
<div id="content">
13+
{children}
14+
</div>
15+
</div>
16+
</>
17+
);
18+
}

_components/Breadcrumbs.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.crumbs {
2+
display: flex;
3+
flex-wrap: wrap;
4+
text-align: center;
5+
margin-top: 0.5rem;
6+
margin-left: -0.75rem;
7+
color: hsl(var(--foreground-secondary));
8+
}
9+
10+
.crumb-link {
11+
display: flex;
12+
align-items: center;
13+
&::after {
14+
content: "";
15+
width: 1em;
16+
height: 1em;
17+
background: url(./img/chevron.svg) no-repeat center;
18+
display: inline-block;
19+
margin-left: 1rem;
20+
}
21+
}

_components/Breadcrumbs.tsx

Lines changed: 22 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
1-
import type {
2-
BreadcrumbItem,
3-
Sidebar as Sidebar_,
4-
SidebarItem,
5-
} from "../types.ts";
6-
import { isSidebarCategory, isSidebarDoc, isSidebarLink } from "../types.ts";
1+
import type { Sidebar as Sidebar_, SidebarItem } from "../types.ts";
72

8-
export function generateCrumbs(
3+
function generateCrumbs(
94
url: string,
105
title: string,
116
items: SidebarItem[],
12-
current: BreadcrumbItem[] = [],
13-
): BreadcrumbItem[] {
7+
current: SidebarItem[] = [],
8+
): SidebarItem[] {
149
for (const item of items) {
15-
const foundTargetPage = (typeof item === "string" && item === url) ||
16-
(isSidebarDoc(item) && item.id === url) ||
17-
(isSidebarLink(item) && item.href === url);
10+
const foundTargetPage = item.href === url;
1811

1912
if (foundTargetPage) {
20-
current.push({ label: title });
13+
current.push({ title: title });
2114
return current;
2215
}
2316

24-
if (isSidebarCategory(item)) {
25-
const childItems: BreadcrumbItem[] = [];
17+
if (item.items) {
18+
const childItems: SidebarItem[] = [];
2619
generateCrumbs(url, title, item.items, childItems);
2720

2821
if (childItems.length > 0) {
2922
if (item.href) {
30-
current.push({ label: item.label, href: item.href });
23+
current.push({ title: item.title, href: item.href });
3124
}
3225
current.push(...childItems);
3326
return current;
@@ -38,26 +31,26 @@ export function generateCrumbs(
3831
return current;
3932
}
4033

41-
export function Breadcrumbs(props: {
34+
export default function (props: {
4235
title: string;
4336
sidebar: Sidebar_;
4437
url: string;
4538
sectionTitle: string;
4639
sectionHref: string;
4740
}) {
48-
const crumbs: BreadcrumbItem[] = [];
41+
const crumbs: SidebarItem[] = [];
4942

5043
for (const section of props.sidebar) {
5144
if (section.href === props.url) {
52-
crumbs.push({ label: props.title });
45+
crumbs.push({ title: props.title });
5346
break;
5447
}
5548

56-
const rootItem = { label: section.title, href: section.href };
49+
const rootItem = { title: section.title, href: section.href };
5750
const potentialCrumbs = generateCrumbs(
5851
props.url,
5952
props.title,
60-
section.items,
53+
section?.items || [],
6154
[rootItem],
6255
);
6356

@@ -68,9 +61,9 @@ export function Breadcrumbs(props: {
6861
}
6962

7063
return (
71-
<nav class="mb-4">
64+
<nav>
7265
<ul
73-
class="flex flex-wrap text-foreground-secondary items-center -ml-3"
66+
class="crumbs"
7467
itemscope
7568
itemtype="https://schema.org/BreadcrumbList"
7669
>
@@ -80,26 +73,14 @@ export function Breadcrumbs(props: {
8073
itemtype="https://schema.org/ListItem"
8174
>
8275
<a
83-
class="block px-3 py-1.5 underline underline-offset-4 decoration-foreground-tertiary hover:text-foreground-secondary hover:underline-medium hover:bg-foreground-tertiary dark:hover:bg-background-secondary dark:hover:text-foreground-primary rounded transition duration-100 text-sm"
76+
class="crumb-link pl-3 py-1.5 underline underline-offset-4 decoration-foreground-tertiary hover:text-foreground-secondary hover:underline-medium hover:bg-foreground-tertiary dark:hover:bg-background-secondary dark:hover:text-foreground-primary rounded transition duration-100 text-sm"
8477
itemprop="item"
8578
href={props.sectionHref}
8679
>
8780
<span itemprop="name">{props.sectionTitle}</span>
8881
</a>
8982
<meta itemprop="position" content="1" />
9083
</li>
91-
<li>
92-
<svg
93-
class="size-4 text-foreground-secondary rotate-90"
94-
xmlns="http://www.w3.org/2000/svg"
95-
viewBox="0 0 24 24"
96-
>
97-
<path
98-
fill="currentColor"
99-
d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"
100-
/>
101-
</svg>
102-
</li>
10384
{crumbs.map((crumb, i) => (
10485
<>
10586
<li
@@ -112,36 +93,23 @@ export function Breadcrumbs(props: {
11293
<a
11394
href={crumb.href}
11495
itemprop="item"
115-
class="block px-3 py-1.5 underline underline-offset-4 decoration-foreground-tertiary hover:text-foreground-secondary hover:underline-medium hover:bg-foreground-tertiary dark:hover:bg-background-secondary dark:hover:text-foreground-primary rounded transition duration-100 text-sm"
96+
class="crumb-link pl-3 py-1.5 underline underline-offset-4 decoration-foreground-tertiary hover:text-foreground-secondary hover:underline-medium hover:bg-foreground-tertiary dark:hover:bg-background-secondary dark:hover:text-foreground-primary rounded transition duration-100 text-sm"
11697
>
117-
<span itemprop="name">{crumb.label}</span>
98+
<span itemprop="name">{crumb.title}</span>
11899
</a>
119100
)
120101
: (
121102
<span itemprop="name" class="block px-3 py-1.5 text-sm">
122-
{crumb.label}
103+
{crumb.title}
123104
</span>
124105
)}
125106
<meta itemprop="position" content={String(i + 2)} />
126107
</li>
127-
{i < crumbs.length - 1 && (
128-
<li>
129-
<svg
130-
class="size-4 text-foreground-secondary rotate-90"
131-
xmlns="http://www.w3.org/2000/svg"
132-
viewBox="0 0 24 24"
133-
>
134-
<path
135-
fill="currentColor"
136-
d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"
137-
>
138-
</path>
139-
</svg>
140-
</li>
141-
)}
142108
</>
143109
))}
144110
</ul>
145111
</nav>
146112
);
147113
}
114+
115+
export const css = `@import './_components/Breadcrumbs.css';`;

_components/CTA.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.docs-cta {
2+
@apply border text-balance text-black font-bold inline-block py-3.5 px-6
3+
rounded-full w-max hover:no-underline transition-colors duration-200 mb-6;
4+
}
5+
6+
.runtime-cta,
7+
.deploy-cta {
8+
@apply border-gray-4 hover:!no-underline !text-gray-4;
9+
}
10+
11+
.runtime-cta {
12+
@apply bg-runtime-400 border-runtime-400 hover:bg-runtime-300;
13+
}
14+
15+
.deploy-cta {
16+
@apply bg-deploy-500 border-deploy-500 hover:bg-deploy-400;
17+
}
18+
19+
.jsr-cta {
20+
@apply bg-jsr-yellow-400 border-jsr-cyan-950 !text-jsr-cyan-950 border-2
21+
hover:!no-underline hover:bg-jsr-yellow-300;
22+
}

_components/CTA.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default function CTA(
2+
{ href, children, type }: { href: string; children: string; type: string },
3+
) {
4+
return (
5+
<a href={href} className={`docs-cta ${type}-cta`}>
6+
{children}
7+
</a>
8+
);
9+
}
10+
11+
export const css = "@import './_components/CTA.css';";

_components/Feedback.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default function Feedback({ file }) {
1+
export default function Feedback({ file }: { file: string | undefined }) {
22
if (!file) {
33
return <></>;
44
} else {

_components/Footer.css

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
footer {
2+
margin-top: 2rem;
23
padding: 3rem;
34
border-top: 1px solid hsl(var(--foreground-tertiary));
45
}
56

67
.footer-nav {
7-
display: grid;
8-
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
9-
gap: 1rem;
8+
display: flex;
9+
flex-direction: column;
10+
row-gap: 3rem;
11+
}
12+
13+
.footer-section {
14+
min-width: 170px;
1015
}
1116

1217
.footer-section-heading {
@@ -38,12 +43,18 @@ footer {
3843
color: hsl(var(--foreground-secondary));
3944
}
4045

41-
@media screen and (min-width: 1240px) {
46+
@media screen and (min-width: 500px) {
4247
footer {
43-
padding: 2vw 3vw;
48+
padding: 2rem 5vw;
4449
}
50+
4551
.footer-nav {
46-
max-width: 1240px;
52+
flex-direction: row;
53+
flex-wrap: wrap;
54+
justify-content: center;
55+
max-width: 1000px;
56+
column-gap: clamp(4rem, 5vw, 65px);
57+
row-gap: 4rem;
4758
margin: 0 auto;
4859
}
4960
}

0 commit comments

Comments
 (0)