Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
72f56d2
feat(site): name the docset in the version picker label
pimlock Nov 23, 2026
f0a33ee
fix(site): link the GitHub icon to the ai-openshell organization
pimlock Nov 23, 2026
5703c65
feat(site): add a community page written in Markdown
pimlock Nov 23, 2026
1e39425
docs: describe website pages, Markdown for agents, and hosting
pimlock Nov 23, 2026
1c62a3e
feat(site): share one header between the landing page and the docs
pimlock Nov 23, 2026
ec0ff88
docs: drop release numbers from the README
pimlock Nov 23, 2026
bf5781a
feat(site): link the docs wordmark home and set the site links apart
pimlock Nov 23, 2026
1e120a6
fix(site): link the #openshell-dev Slack channel
pimlock Nov 23, 2026
da2acad
feat(site): share an auto/light/dark theme toggle between the landing…
pimlock Nov 23, 2026
fc98fb1
feat(site): separate the site bar from the docs tabs with a line
pimlock Nov 23, 2026
42584e5
feat(site): search the docs and the website pages from every page
pimlock Nov 23, 2026
9630aea
feat(site): organize the community page like OpenTelemetry's, with icons
pimlock Nov 23, 2026
e13d949
fix(site): keep the header from shifting between the landing page and…
pimlock Nov 23, 2026
a920e1d
feat(site): drop the arrow from the landing page's Documentation button
pimlock Nov 23, 2026
2e73920
feat(site): share one site bar and search between the docs and the we…
pimlock Nov 23, 2026
c864d94
docs: keep the README to an overview and move build details to CONTRI…
pimlock Nov 24, 2026
1c2fd2d
feat(site): open links to other sites in a new tab on the website pages
pimlock Nov 24, 2026
03fddba
refactor(site): rename www/ to website/
pimlock Nov 24, 2026
e54417f
feat(site): underline the current site link
pimlock Nov 24, 2026
4432a41
Merge remote-tracking branch 'origin/main' into feat/community-page/p…
pimlock Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/spdx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ jobs:
- uses: ai-openshell/workflows/spdx-check@0b051efd25c3f7319634fed863d2e03e1bd55d7b # main
with:
include: "*"
# LICENSE is the license text; the CNCF logos are third-party artwork.
exclude: "LICENSE site/static/cncf/*"
# LICENSE is the license text; the CNCF, GitHub, and Slack logos are
# third-party artwork.
exclude: "LICENSE site/static/cncf/* website/icons/*"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ site/src/content/docs/
site/src/generated/
site/public/
site/src/styles/tokens.css
site/src/styles/site-bar.css
119 changes: 99 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

# Contributing to the OpenShell docs site

This repository holds the site build, theme, and navigation. Page content lives
in each source repository; change it there. See the [README](README.md) for
how the build works.
This repository holds the site build, theme, and navigation, and the pages
outside the docs. Docs content lives in each source repository; change it
there. See the [README](README.md) for an overview.

## Setup

Expand All @@ -16,22 +16,100 @@ mise install
mise run install
```

| Task | What it does |
| ------------------- | -------------------------------------------------------- |
| `mise run build` | Fetch every source and build the site into `site/dist` |
| `mise run serve` | Serve the built site at <http://127.0.0.1:4410/docs/> |
| `mise run website` | Build the site and add the landing page into `build/website` |
| `mise run serve-website` | Serve the website at <http://127.0.0.1:4410/> |
| `mise run assemble` | Fetch and assemble the sources without building the site |
| `mise run test` | Run the assembler's unit tests |
| `mise run lint` | Check formatting and lint with [Biome](https://biomejs.dev/) |
| `mise run format` | Format the code and apply safe lint fixes |
| `mise run typecheck` | Assemble the sources and type-check the site with `astro check` |

To build against a local checkout instead of a source's `dev` branch, run
`node assembler/assemble.mjs --base /docs/ --local core=../OpenShell` before
`BASE_PATH=/docs/ npm run site`. Broken links in a local checkout fail the
build; in fetched versions they only warn.
| Task | What it does |
| ------------------------ | ------------------------------------------------------------------ |
| `mise run website` | Build the docs and the website pages into `build/website` |
| `mise run serve-website` | Serve the website at <http://127.0.0.1:4410/> |
| `mise run build` | Fetch every source and build only the docs into `site/dist` |
| `mise run serve` | Serve the docs build at <http://127.0.0.1:4410/docs/> |
| `mise run assemble` | Fetch and assemble the sources without building the site |
| `mise run test` | Run the assembler's unit tests |
| `mise run lint` | Check formatting and lint with [Biome](https://biomejs.dev/) |
| `mise run format` | Format the code and apply safe lint fixes |
| `mise run typecheck` | Assemble the sources and type-check the site with `astro check` |

## How the docs build works

[`sources.yml`](sources.yml) lists each source repository, where it's mounted,
and which tags to publish; `dev` is a branch built as an extra, unreleased
version. The assembler ([`assembler/`](assembler/)) fetches only the docs
directory at each ref, reads it in its own format (Fern `index.yml`, mdBook
`SUMMARY.md`, or `docset.yml`), and writes the Starlight content, navigation,
and Markdown copies. The commits it used are recorded in
`build/assembled/sources.lock.json`.

Broken links in fetched versions are warnings, so one repository can't block
the site. To check a change to a repository's docs, build against a local
checkout, where broken links are errors:

```shell
node assembler/assemble.mjs --base /docs/ --local core=../OpenShell
BASE_PATH=/docs/ npm run site
```

Pull request previews for source repositories are tracked in
[#2](https://github.com/ai-openshell/docs/issues/2).

## Website pages

[`website/`](website/) holds the website's own pages, the ones outside the docs;
the docs come from the sources and are built in `site/`.
[`scripts/website.mjs`](scripts/website.mjs) puts the files in `website/` at `/`
and the docs build at `/docs/`, into `build/website/`. The landing page,
[`website/index.html`](website/index.html), is hand-written HTML. Other pages,
such as `/community/`, are Markdown files in `website/` with a `title` and
`description` in their front matter; each `website/<name>.md` is rendered into
the landing page's shell at `/<name>/`.

To add a page, add a Markdown file and its link to
[`theme/nav.json`](theme/nav.json). `:name:` in a page, such as `:github:`,
inserts the icon `website/icons/<name>.svg`.

## Site bar and search

Every page, docs included, renders the same site bar from
[`theme/site-bar.mjs`](theme/site-bar.mjs): wordmark, site links, search,
GitHub, and theme toggle. The docs header
([`Header.astro`](site/src/components/overrides/Header.astro)) and
`scripts/website.mjs` both call it, and both use the same styles
(`theme/site-bar.css`) and scripts (`theme/search.js`,
`theme/theme-toggle.js`), so change the bar only in `theme/`.

Search shows [Pagefind](https://pagefind.app/)'s UI in the site bar's dialog;
Starlight's own search box isn't used. Starlight builds the docs index (the
latest release of each docset only), and `scripts/website.mjs` indexes the
website pages into `/pagefind-website/`. When built with `WEBSITE=1`, as Netlify
and `mise run website` do, search merges the two, with the website pages at
half weight so they don't outrank the docs. Each page records its section
(Core, Go SDK, Community) as Pagefind metadata, which the results show as a
label.

## Markdown for agents

Every page has a Markdown copy at its URL plus `.md`, such as
`/docs/about/overview.md` or `/community.md`. The docs list theirs in
`/docs/llms.txt`, and each docs page links to its copy in the page actions menu
(Copy page, View as Markdown, Open in Claude or ChatGPT). On Netlify, an
[edge function](netlify/edge-functions/markdown.js) serves the copy at the
page's own URL to clients that send `Accept: text/markdown`;
`mise run serve-website` does the same locally.

The assembler writes the docs copies from each page's source, so they keep the
source's text rather than the rendered HTML. Source repositories can mark
content for one output only: `<llms-only>` blocks appear only in the Markdown
copy, and `<llms-ignore>` blocks only on the site.

## Hosting

The website is hosted on [Netlify](https://www.netlify.com/) under the CNCF's
account. [`netlify.toml`](netlify.toml) holds the build settings, which
override the Netlify UI: Netlify runs `npm run build && npm run website` with
`BASE_PATH=/docs/` and `WEBSITE=1`, and publishes `build/website`. Netlify also
builds a deploy preview for each pull request.

The [Site workflow](.github/workflows/site.yml) builds the docs on every pull
request and publishes them to GitHub Pages from `main`, at `/<repository>/`
and without the website pages.

## Commits and pull requests

Expand All @@ -44,4 +122,5 @@ build; in fetched versions they only warn.
a comment in its first 10 lines; the `SPDX` workflow checks it. In `.mdx`
and `.astro` files, put it in the front matter. A file that can't hold a
comment, such as JSON or an image, gets a `<file>.license` file containing
the line instead.
the line instead. Third-party artwork, such as the CNCF logos and
`website/icons/`, is excluded.
50 changes: 20 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,45 @@

# OpenShell docs

Builds the [OpenShell](https://github.com/ai-openshell/openshell) docs site from the
docs of several repositories. Each repository keeps its docs next to its code
and ships them with its releases. This repository holds no page content: it
owns the build, the theme, and the navigation.
Builds the [OpenShell](https://github.com/ai-openshell/openshell) website and
docs from the docs of several repositories. Each repository keeps its docs next
to its code and ships them with its releases. This repository holds no docs
content: it owns the build, the theme, the navigation, and the few pages outside
the docs, such as the landing page, in [`website/`](website/).

| Docset | Repository | Path | Versions |
| --------- | ------------------------------------------------------------------- | ----------- | --------------------------------- |
| OpenShell | [ai-openshell/openshell](https://github.com/ai-openshell/openshell) | `docs/` | dev (`main`), 0.1.9, 0.1.8, 0.1.7 |
| Go SDK | [ai-openshell/sdk-go](https://github.com/ai-openshell/sdk-go) | `docs/src/` | dev (`main`), 0.1.8, 0.1.7 |
| Docset | Repository | Path | Dev branch |
| --------- | ------------------------------------------------------------------- | ----------- | ---------- |
| OpenShell | [ai-openshell/openshell](https://github.com/ai-openshell/openshell) | `docs/` | `main` |
| Go SDK | [ai-openshell/sdk-go](https://github.com/ai-openshell/sdk-go) | `docs/src/` | `main` |

## How it works

[`sources.yml`](sources.yml) lists each repository, where it's mounted, and
which tags to publish. The build fetches only the docs directory at each tag or
branch, reads it in its own format (Fern `index.yml`, mdBook `SUMMARY.md`, or
`docset.yml`), checks every link, and builds the site with
branch, checks every link, and builds the docs with
[Starlight](https://starlight.astro.build/). The newest release of each
repository is published without a version in the URL, such as
`/about/overview/` or `/sdks/go/`, so links always show the current docs. Other
versions have their own path, such as `/0.1.8/about/overview/` or
`/sdks/go/dev/`.
`/docs/about/overview/`; other versions have their own path, such as
`/docs/0.1.8/about/overview/` or `/docs/sdks/go/dev/`.

Every page also has a Markdown copy at its path plus `.md`, listed in
`/llms.txt`. On Netlify, an [edge function](netlify/edge-functions/markdown.js)
serves that copy at the page's own URL to clients that send
`Accept: text/markdown`.

Broken links in fetched versions are warnings, so one repository can't block
the site. To check a change to a repository's docs, build with `--local` (see
[CONTRIBUTING.md](CONTRIBUTING.md)), where broken links are errors. Pull request
previews for source repositories are tracked in
[#2](https://github.com/ai-openshell/docs/issues/2).
The website serves the landing page and the community page at `/` and the docs
at `/docs/`, all with one site bar and one search. Every page also has a
Markdown copy for agents at its URL plus `.md`. The site is hosted on Netlify
under the CNCF's account.

To publish a new release, add its tag to `sources.yml`.

The published website serves a small landing page from [`www/`](www/)
at `/` and the docs at `/docs/`. [`scripts/website.mjs`](scripts/website.mjs)
combines the two after the docs build.

## Run it locally

```shell
mise install
mise run install
mise run build
mise run serve
mise run website
mise run serve-website
```

See [CONTRIBUTING.md](CONTRIBUTING.md) for more.
See [CONTRIBUTING.md](CONTRIBUTING.md) for the build details, the other tasks,
and how to change the site.

## License

Expand Down
6 changes: 4 additions & 2 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ run = "npm run site"

[tasks.website]
description = "Build the site, then add the landing page at / with the docs at /docs/"
depends = ["build"]
run = "npm run website"
depends = ["assemble"]
# WEBSITE=1 makes the docs search include the website pages, as on Netlify.
env = { BASE_PATH = "/docs/", WEBSITE = "1" }
run = ["npm run site", "npm run website"]

[tasks.serve-website]
description = "Serve the website at http://127.0.0.1:4410/"
Expand Down
2 changes: 2 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ publish = "build/website"

[build.environment]
BASE_PATH = "/docs/"
# Docs search also covers the website pages (pagefind-website, see scripts/website.mjs).
WEBSITE = "1"

# A page's URL serves HTML or Markdown depending on Accept (see
# netlify/edge-functions/markdown.js), so tell caches to key on it. The edge
Expand Down
35 changes: 35 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
"@astrojs/starlight": "0.42.10",
"astro": "7.4.11",
"github-slugger": "2.0.0",
"pagefind": "1.6.0",
"pele": "1.13.0",
"rehype-stringify": "10.0.1",
"remark-frontmatter": "5.0.0",
"remark-gfm": "4.0.1",
"remark-mdx": "3.1.1",
"remark-parse": "11.0.0",
"remark-rehype": "11.1.2",
"remark-stringify": "11.0.0",
"unified": "11.0.5",
"unist-util-visit": "5.2.0",
Expand Down
Loading
Loading