Skip to content

Commit a91b8a2

Browse files
committed
Moving to docs theme
1 parent eaff703 commit a91b8a2

Some content is hidden

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

49 files changed

+396
-2019
lines changed

www/astro.config.mjs

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1-
import { defineConfig } from "astro/config"
1+
import theme from "toolbeam-docs-theme"
22
import starlight from "@astrojs/starlight"
3+
import { defineConfig } from "astro/config"
34
import { rehypeHeadingIds } from "@astrojs/markdown-remark"
45
import rehypeAutolinkHeadings from "rehype-autolink-headings"
5-
import config from "./config"
6+
7+
const github = "https://github.com/toolbeam/openauth"
8+
const discord = "https://sst.dev/discord"
9+
const url = "https://openauth.js.org"
610

711
// https://astro.build/config
812
export default defineConfig({
9-
site: "https://openauth.js.org",
13+
site: url,
1014
trailingSlash: 'always',
1115
devToolbar: {
1216
enabled: false,
1317
},
1418
integrations: [
1519
starlight({
20+
plugins: [theme()],
1621
title: "OpenAuth",
1722
description: "Universal, standards-based auth provider.",
1823
head: [
@@ -41,39 +46,40 @@ export default defineConfig({
4146
media: "(prefers-color-scheme: dark)",
4247
},
4348
},
49+
{
50+
tag: "meta",
51+
attrs: {
52+
property: "og:image",
53+
content: `${url}/social-share.png`,
54+
},
55+
},
56+
{
57+
tag: "meta",
58+
attrs: {
59+
property: "twitter:image",
60+
content: `${url}/social-share.png`,
61+
},
62+
},
4463
],
45-
pagination: false,
4664
logo: {
4765
light: "./src/assets/logo-light.svg",
4866
dark: "./src/assets/logo-dark.svg",
4967
replacesTitle: true,
5068
},
5169
social: {
52-
github: config.github,
53-
discord: config.discord,
70+
github,
71+
discord,
5472
},
5573
lastUpdated: true,
5674
editLink: {
57-
baseUrl: `${config.github}/edit/master/www/`,
75+
baseUrl: `${github}/edit/master/www/`,
5876
},
5977
components: {
6078
Hero: "./src/components/Hero.astro",
61-
Head: "./src/components/Head.astro",
62-
Header: "./src/components/Header.astro",
63-
Footer: "./src/components/Footer.astro",
64-
PageTitle: "./src/components/PageTitle.astro",
6579
},
6680
customCss: [
67-
"@fontsource/ibm-plex-mono/400.css",
68-
"@fontsource/ibm-plex-mono/400-italic.css",
69-
"@fontsource/ibm-plex-mono/500.css",
70-
"@fontsource/ibm-plex-mono/600.css",
71-
"@fontsource/ibm-plex-mono/700.css",
7281
"./src/custom.css",
73-
"./src/styles/tsdoc.css",
7482
"./src/styles/lander.css",
75-
"./src/styles/markdown.css",
76-
"./src/styles/headings.css",
7783
],
7884
sidebar: [
7985
{ label: "Intro", slug: "docs" },

www/bun.lockb

25.8 KB
Binary file not shown.

www/config.ts

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

www/generate.ts

Lines changed: 34 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -311,22 +311,14 @@ function renderHeader(input: {
311311
editUrl: string | boolean
312312
description: string
313313
}) {
314-
const relativePath = path.relative(
315-
path.dirname(path.join(OUTPUT_DIR, `${input.moduleName}.mdx`)),
316-
"src/components/tsdoc",
317-
)
318314
return [
319315
`---`,
320316
`title: ${input.title}`,
321317
`editUrl: ${input.editUrl}`,
322318
`description: ${input.description}`,
323319
`---`,
324320
"",
325-
`import Segment from '${relativePath}/Segment.astro';`,
326-
`import Section from '${relativePath}/Section.astro';`,
327-
`import NestedTitle from '${relativePath}/NestedTitle.astro';`,
328-
`import InlineSection from '${relativePath}/InlineSection.astro';`,
329-
`import { Tabs, TabItem } from '@astrojs/starlight/components';`,
321+
"import { Segment, Section, NestedTitle, InlineSection } from 'toolbeam-docs-theme/components'",
330322
"",
331323
]
332324
}
@@ -497,16 +489,16 @@ function renderComment(declaration: TypeDoc.Reflection) {
497489

498490
return [
499491
declaration instanceof TypeDoc.DeclarationReflection &&
500-
declaration.defaultValue
492+
declaration.defaultValue
501493
? [
502-
``,
503-
`<InlineSection>`,
504-
`**Default** ${renderType({
505-
type: "literal",
506-
value: declaration.defaultValue.replace(/"/g, ""),
507-
} as TypeDoc.LiteralType)}`,
508-
`</InlineSection>`,
509-
]
494+
``,
495+
`<InlineSection>`,
496+
`**Default** ${renderType({
497+
type: "literal",
498+
value: declaration.defaultValue.replace(/"/g, ""),
499+
} as TypeDoc.LiteralType)}`,
500+
`</InlineSection>`,
501+
]
510502
: [],
511503
declaration.comment.blockTags
512504
.filter((tag) => tag.tag === "@default")
@@ -518,13 +510,13 @@ function renderComment(declaration: TypeDoc.Reflection) {
518510
// Otherwise render it as a comment ie. No domains configured
519511
tag.content.length === 1 && tag.content[0].kind === "code"
520512
? `**Default** ${renderType(
521-
new TypeDoc.IntrinsicType(
522-
tag.content[0].text
523-
.replace(/`/g, "")
524-
.replace(/{/g, "&lcub;")
525-
.replace(/}/g, "&rcub;"),
526-
),
527-
)}`
513+
new TypeDoc.IntrinsicType(
514+
tag.content[0].text
515+
.replace(/`/g, "")
516+
.replace(/{/g, "&lcub;")
517+
.replace(/}/g, "&rcub;"),
518+
),
519+
)}`
528520
: `**Default** ${tag.content.map((c) => c.text)}`,
529521
`</InlineSection>`,
530522
]
@@ -546,11 +538,11 @@ function renderSignatureAsType(signature: TypeDoc.SignatureReflection) {
546538
.map(
547539
(parameter) =>
548540
`${renderParameter(parameter)}: ${
549-
// If the type is an object, render it inline
550-
parameter.type?.type === "reflection" &&
541+
// If the type is an object, render it inline
542+
parameter.type?.type === "reflection" &&
551543
parameter.type.declaration.kind === TypeDoc.ReflectionKind.TypeLiteral
552-
? renderObjectTypeInline(parameter.type)
553-
: renderType(parameter.type!)
544+
? renderObjectTypeInline(parameter.type)
545+
: renderType(parameter.type!)
554546
}`,
555547
)
556548
.join(", ")
@@ -696,8 +688,8 @@ function renderUnionType(type: TypeDoc.UnionType) {
696688
function renderArrayType(type: TypeDoc.ArrayType) {
697689
return type.elementType.type === "union"
698690
? `<code class="symbol">(</code>${renderType(
699-
type.elementType,
700-
)}<code class="symbol">)[]</code>`
691+
type.elementType,
692+
)}<code class="symbol">)[]</code>`
701693
: `${renderType(type.elementType)}<code class="symbol">[]</code>`
702694
}
703695
function renderCallbackType(type: TypeDoc.ReflectionType) {
@@ -713,7 +705,7 @@ function renderObjectTypeInline(type: TypeDoc.ReflectionType): Text {
713705
`<code class="symbol">&colon; </code>`,
714706
// If rendering inline, also render children inline
715707
c.type?.type === "reflection" &&
716-
c.type.declaration.kind === TypeDoc.ReflectionKind.TypeLiteral
708+
c.type.declaration.kind === TypeDoc.ReflectionKind.TypeLiteral
717709
? renderObjectTypeInline(c.type)
718710
: renderType(c.type!),
719711
].join(""),
@@ -809,17 +801,17 @@ function flattenNestedTypes(
809801
{ prefix, subType, depth },
810802
...(subType.kind === TypeDoc.ReflectionKind.Property
811803
? flattenNestedTypes(
812-
subType.type!,
813-
`${prefix}.${subType.name}`,
814-
depth + 1,
815-
)
804+
subType.type!,
805+
`${prefix}.${subType.name}`,
806+
depth + 1,
807+
)
816808
: []),
817809
...(subType.kind === TypeDoc.ReflectionKind.Accessor
818810
? flattenNestedTypes(
819-
subType.getSignature?.type!,
820-
`${prefix}.${subType.name}`,
821-
depth + 1,
822-
)
811+
subType.getSignature?.type!,
812+
`${prefix}.${subType.name}`,
813+
depth + 1,
814+
)
823815
: []),
824816
])
825817
}
@@ -847,8 +839,8 @@ function configureLogger() {
847839
return
848840
}
849841

850-
console.debug = () => {}
851-
console.warn = () => {}
842+
console.debug = () => { }
843+
console.warn = () => { }
852844
}
853845

854846
function printWarnings() {

www/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
},
1212
"dependencies": {
1313
"@astrojs/markdown-remark": "^6.0.1",
14-
"@astrojs/starlight": "^0.29.2",
14+
"@astrojs/starlight": "^0.32.0",
1515
"@fontsource/ibm-plex-mono": "^5.1.0",
16-
"astro": "^4.16.10",
16+
"astro": "^5.1.5",
1717
"rehype-autolink-headings": "^7.1.0",
18-
"sharp": "^0.32.5"
18+
"sharp": "^0.33.4",
19+
"toolbeam-docs-theme": "^0.0.3"
1920
},
2021
"devDependencies": {
2122
"typedoc": "^0.27.5"

www/src/components/Footer.astro

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

www/src/components/Head.astro

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

0 commit comments

Comments
 (0)