From 6cfcf51752ec8d40104cead0b2602885c77a9c79 Mon Sep 17 00:00:00 2001 From: Jay V Date: Wed, 21 May 2025 14:24:53 -0400 Subject: adding docs site --- www/src/assets/lander/check.svg | 2 + www/src/assets/lander/copy.svg | 2 + www/src/assets/logo-dark.svg | 11 ++ www/src/assets/logo-light.svg | 11 ++ www/src/components/Hero.astro | 11 ++ www/src/components/Lander.astro | 269 ++++++++++++++++++++++++++++++ www/src/content.config.ts | 7 + www/src/content/docs/guides/example.md | 11 ++ www/src/content/docs/index.mdx | 12 ++ www/src/content/docs/reference/example.md | 11 ++ 10 files changed, 347 insertions(+) create mode 100644 www/src/assets/lander/check.svg create mode 100644 www/src/assets/lander/copy.svg create mode 100644 www/src/assets/logo-dark.svg create mode 100644 www/src/assets/logo-light.svg create mode 100644 www/src/components/Hero.astro create mode 100644 www/src/components/Lander.astro create mode 100644 www/src/content.config.ts create mode 100644 www/src/content/docs/guides/example.md create mode 100644 www/src/content/docs/index.mdx create mode 100644 www/src/content/docs/reference/example.md (limited to 'www/src') diff --git a/www/src/assets/lander/check.svg b/www/src/assets/lander/check.svg new file mode 100644 index 000000000..22de6f2a8 --- /dev/null +++ b/www/src/assets/lander/check.svg @@ -0,0 +1,2 @@ + + diff --git a/www/src/assets/lander/copy.svg b/www/src/assets/lander/copy.svg new file mode 100644 index 000000000..f1baac30a --- /dev/null +++ b/www/src/assets/lander/copy.svg @@ -0,0 +1,2 @@ + + diff --git a/www/src/assets/logo-dark.svg b/www/src/assets/logo-dark.svg new file mode 100644 index 000000000..8fd212081 --- /dev/null +++ b/www/src/assets/logo-dark.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/www/src/assets/logo-light.svg b/www/src/assets/logo-light.svg new file mode 100644 index 000000000..0a9007e1a --- /dev/null +++ b/www/src/assets/logo-light.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/www/src/components/Hero.astro b/www/src/components/Hero.astro new file mode 100644 index 000000000..f80f85266 --- /dev/null +++ b/www/src/components/Hero.astro @@ -0,0 +1,11 @@ +--- +import Default from '@astrojs/starlight/components/Hero.astro'; +import Lander from './Lander.astro'; + +const { slug } = Astro.locals.starlightRoute.entry; +--- + +{ slug === "" + ? + : +} diff --git a/www/src/components/Lander.astro b/www/src/components/Lander.astro new file mode 100644 index 000000000..d27358f8f --- /dev/null +++ b/www/src/components/Lander.astro @@ -0,0 +1,269 @@ +--- +import { Image } from 'astro:assets'; +import config from "virtual:starlight/user-config"; +import type { Props } from '@astrojs/starlight/props'; + +import CopyIcon from "../assets/lander/copy.svg"; +import CheckIcon from "../assets/lander/check.svg"; + +const { data } = Astro.locals.starlightRoute.entry; +const { title = data.title, tagline, image, actions = [] } = data.hero || {}; + +const imageAttrs = { + loading: 'eager' as const, + decoding: 'async' as const, + width: 400, + alt: image?.alt || '', +}; + +const github = config.social.filter(s => s.icon === 'github')[0]; + +const command = "npm i -g"; +const pkg = "opencode"; + +let darkImage: ImageMetadata | undefined; +let lightImage: ImageMetadata | undefined; +let rawHtml: string | undefined; +if (image) { + if ('file' in image) { + darkImage = image.file; + } else if ('dark' in image) { + darkImage = image.dark; + lightImage = image.light; + } else { + rawHtml = image.html; + } +} +--- +
+
+ +

The AI coding agent built for the terminal.

+
+ +
+ +
+ +
+ +
+ +
+
    +
  • Native TUI: A native terminal UI for a smoother, snappier experience.
  • +
  • LSP enabled: Loads the right LSPs for your codebase. Helps the LLM make fewer mistakes.
  • +
  • Multi-session: Start multiple conversations in a project to have agents working in parallel.
  • +
  • Use any model: Supports all the models from OpenAI, Anthropic, Google, OpenRouter, and more.
  • +
  • Change tracking: View the file changes from the current conversation in the sidebar.
  • +
  • Edit with Vim: Use Vim as an external editor to compose longer messages.
  • +
+
+ + +
+ + + + + + diff --git a/www/src/content.config.ts b/www/src/content.config.ts new file mode 100644 index 000000000..d9ee8c9d1 --- /dev/null +++ b/www/src/content.config.ts @@ -0,0 +1,7 @@ +import { defineCollection } from 'astro:content'; +import { docsLoader } from '@astrojs/starlight/loaders'; +import { docsSchema } from '@astrojs/starlight/schema'; + +export const collections = { + docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), +}; diff --git a/www/src/content/docs/guides/example.md b/www/src/content/docs/guides/example.md new file mode 100644 index 000000000..ebd0f3bc7 --- /dev/null +++ b/www/src/content/docs/guides/example.md @@ -0,0 +1,11 @@ +--- +title: Example Guide +description: A guide in my new Starlight docs site. +--- + +Guides lead a user through a specific task they want to accomplish, often with a sequence of steps. +Writing a good guide requires thinking about what your users are trying to do. + +## Further reading + +- Read [about how-to guides](https://diataxis.fr/how-to-guides/) in the Diátaxis framework diff --git a/www/src/content/docs/index.mdx b/www/src/content/docs/index.mdx new file mode 100644 index 000000000..176520ec5 --- /dev/null +++ b/www/src/content/docs/index.mdx @@ -0,0 +1,12 @@ +--- +title: OpenCode +description: The AI coding agent built for the terminal. +template: splash +hero: + title: The AI coding agent built for the terminal. + tagline: The AI coding agent built for the terminal. + image: + dark: ../../assets/logo-dark.svg + light: ../../assets/logo-light.svg + alt: OpenCode logo +--- diff --git a/www/src/content/docs/reference/example.md b/www/src/content/docs/reference/example.md new file mode 100644 index 000000000..0224f096c --- /dev/null +++ b/www/src/content/docs/reference/example.md @@ -0,0 +1,11 @@ +--- +title: Example Reference +description: A reference page in my new Starlight docs site. +--- + +Reference pages are ideal for outlining how things work in terse and clear terms. +Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what you're documenting. + +## Further reading + +- Read [about reference](https://diataxis.fr/reference/) in the Diátaxis framework -- cgit v1.2.3