diff --git a/package.json b/package.json index 795f608..83509fb 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "scripts": { "ci:biome": "biome ci", "build": "tsdown", + "build:docs": "pnpm -C packages/docs run build", "typecheck": "pnpm -r run typecheck", "test": "vitest run" } diff --git a/packages/docs/astro.config.mjs b/packages/docs/astro.config.mjs new file mode 100644 index 0000000..aedd866 --- /dev/null +++ b/packages/docs/astro.config.mjs @@ -0,0 +1,61 @@ +// @ts-check + +import starlight from "@astrojs/starlight"; +import { defineConfig } from "astro/config"; +import starlightLinksValidator from "starlight-links-validator"; + +// https://astro.build/config +export default defineConfig({ + experimental: { + clientPrerender: true, + }, + integrations: [ + starlight({ + title: "Mighty", + plugins: [starlightLinksValidator()], + logo: { + src: "@/assets/mighty.svg", + }, + components: { + SiteTitle: "@/components/starlight/SiteTitle.astro", + Hero: "@/components/starlight/Hero.astro", + }, + customCss: ["./src/styles/custom.css"], + social: [ + { + icon: "github", + label: "GitHub", + href: "https://github.com/gomighty/mighty", + }, + ], + head: [ + { + tag: "link", + attrs: { + rel: "icon", + type: "image/png", + href: "/favicon-96x96.png", + sizes: "96x96", + }, + }, + ], + sidebar: [ + { + label: "Hello, World!", + autogenerate: { directory: "guides/hello-world" }, + }, + { + label: "Core Concepts", + autogenerate: { directory: "guides/core-concepts" }, + }, + { + label: "Backend Adapters", + autogenerate: { directory: "guides/backend-adapters" }, + }, + { + slug: "guides/roadmap", + }, + ], + }), + ], +}); diff --git a/packages/docs/package.json b/packages/docs/package.json new file mode 100644 index 0000000..81531b4 --- /dev/null +++ b/packages/docs/package.json @@ -0,0 +1,28 @@ +{ + "name": "@gomighty/docs", + "private": true, + "type": "module", + "version": "0.0.1", + "scripts": { + "dev": "astro dev", + "start": "astro dev", + "build": "astro build", + "preview": "astro preview", + "astro": "astro", + "typecheck": "astro check" + }, + "engines": { + "node": "24.x" + }, + "dependencies": { + "@astrojs/starlight": "^0.38.2", + "astro": "catalog:", + "motion": "^12.23.12", + "sharp": "^0.34.2", + "starlight-links-validator": "^0.20.1" + }, + "devDependencies": { + "@astrojs/check": "^0.9.4", + "typescript": "^5.9.3" + } +} diff --git a/packages/docs/public/favicon-96x96.png b/packages/docs/public/favicon-96x96.png new file mode 100644 index 0000000..fe95739 Binary files /dev/null and b/packages/docs/public/favicon-96x96.png differ diff --git a/packages/docs/public/favicon.svg b/packages/docs/public/favicon.svg new file mode 100644 index 0000000..8febb82 --- /dev/null +++ b/packages/docs/public/favicon.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/docs/src/assets/mighty.svg b/packages/docs/src/assets/mighty.svg new file mode 100644 index 0000000..39e133d --- /dev/null +++ b/packages/docs/src/assets/mighty.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/docs/src/components/PackageManagerTabs.astro b/packages/docs/src/components/PackageManagerTabs.astro new file mode 100644 index 0000000..b7e5bd4 --- /dev/null +++ b/packages/docs/src/components/PackageManagerTabs.astro @@ -0,0 +1,15 @@ +--- +import { TabItem, Tabs } from "@astrojs/starlight/components"; +--- + + + + + + + + + + + + diff --git a/packages/docs/src/components/starlight/Hero.astro b/packages/docs/src/components/starlight/Hero.astro new file mode 100644 index 0000000..fe67f35 --- /dev/null +++ b/packages/docs/src/components/starlight/Hero.astro @@ -0,0 +1,143 @@ +--- +import { LinkButton } from "@astrojs/starlight/components"; +import MightyLogo from "@/assets/mighty.svg"; + +const { data } = Astro.locals.starlightRoute.entry; +const { title = data.title, tagline, actions = [] } = data.hero || {}; + +const PAGE_TITLE_ID = "_top"; +--- + +
+