Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 3 additions & 18 deletions website/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { pluginTerminal } from "./src/lib/ec-terminal.mjs";
import rehypeExternalLinks from "./src/lib/rehype-external-links.mjs";
import rehypeTableRegions from "./src/lib/rehype-table-regions.mjs";
import { en } from "./src/data/copy/en.ts";
import { RELEASES_URL } from "./src/data/agents.ts";
import { DOCS_SIDEBAR } from "./src/data/docs-sidebar.ts";

const SITE = "https://harness-kit.dev";
// The landing's English share image (public/og.png, scripts/og.mjs); share tags want an absolute URL.
Expand Down Expand Up @@ -93,23 +93,8 @@ export default defineConfig({
{ tag: "meta", attrs: { property: "og:image:alt", content: `HarnessKit · ${en.hero.title}` } },
{ tag: "meta", attrs: { name: "twitter:image", content: SHARE_IMAGE } },
],
// Groups start closed; Starlight opens the one holding the current page.
// Each label with its Chinese, as the App's zh UI and the landing name them; the pages under each come from
// their own titles.
// Getting started stays open: it is the group a first visit needs. Troubleshooting and the FAQ sit before
// Contributing, in the order a reader with a problem looks.
sidebar: [
{ label: "Overview", translations: { "zh-CN": "概览" }, slug: "docs" },
{ label: "Getting started", translations: { "zh-CN": "快速开始" }, collapsed: false, autogenerate: { directory: "docs/getting-started" } },
{ label: "Guides", translations: { "zh-CN": "使用指南" }, collapsed: true, autogenerate: { directory: "docs/guides" } },
{ label: "How it works", translations: { "zh-CN": "工作原理" }, collapsed: true, autogenerate: { directory: "docs/how-it-works" } },
{ label: "Reference", translations: { "zh-CN": "参考" }, collapsed: true, autogenerate: { directory: "docs/reference" } },
{ label: "Troubleshooting", translations: { "zh-CN": "常见问题排查" }, slug: "docs/troubleshooting" },
{ label: "FAQ", translations: { "zh-CN": "常见问题" }, slug: "docs/faq" },
{ label: "Contributing", translations: { "zh-CN": "参与贡献" }, collapsed: true, autogenerate: { directory: "docs/contributing" } },
// The landing footer's Changelog link, so release notes are one click from the docs too.
{ label: "Release notes ↗", translations: { "zh-CN": "更新日志 ↗" }, link: RELEASES_URL, attrs: { target: "_blank", rel: "noopener" } },
],
// In its own module, which /llms.txt also reads (src/pages/llms.txt.ts).
sidebar: DOCS_SIDEBAR,
social: [{ icon: "github", label: "GitHub", href: "https://github.com/RealZST/HarnessKit" }],
}),
],
Expand Down
Binary file added website/public/favicon.ico
Binary file not shown.
Binary file modified website/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions website/src/data/docs-sidebar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { RELEASES_URL } from "./agents";

// The docs sidebar (astro.config.mjs); /llms.txt lists the docs in the same groups and order (src/pages/llms.txt.ts).
// Groups start closed; Starlight opens the one holding the current page.
// Each label with its Chinese, as the App's zh UI and the landing name them; the pages under each come from
// their own titles.
// Getting started stays open: it is the group a first visit needs. Troubleshooting and the FAQ sit before
// Contributing, in the order a reader with a problem looks.
export const DOCS_SIDEBAR = [
{ label: "Overview", translations: { "zh-CN": "概览" }, slug: "docs" },
{ label: "Getting started", translations: { "zh-CN": "快速开始" }, collapsed: false, autogenerate: { directory: "docs/getting-started" } },
{ label: "Guides", translations: { "zh-CN": "使用指南" }, collapsed: true, autogenerate: { directory: "docs/guides" } },
{ label: "How it works", translations: { "zh-CN": "工作原理" }, collapsed: true, autogenerate: { directory: "docs/how-it-works" } },
{ label: "Reference", translations: { "zh-CN": "参考" }, collapsed: true, autogenerate: { directory: "docs/reference" } },
{ label: "Troubleshooting", translations: { "zh-CN": "常见问题排查" }, slug: "docs/troubleshooting" },
{ label: "FAQ", translations: { "zh-CN": "常见问题" }, slug: "docs/faq" },
{ label: "Contributing", translations: { "zh-CN": "参与贡献" }, collapsed: true, autogenerate: { directory: "docs/contributing" } },
// The landing footer's Changelog link, so release notes are one click from the docs too.
{ label: "Release notes ↗", translations: { "zh-CN": "更新日志 ↗" }, link: RELEASES_URL, attrs: { target: "_blank", rel: "noopener" } },
];
29 changes: 29 additions & 0 deletions website/src/pages/llms.txt.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { APIRoute } from "astro";
import { getCollection, type CollectionEntry } from "astro:content";
import { en } from "../data/copy/en";
import { DOCS_SIDEBAR } from "../data/docs-sidebar";

// /llms.txt (llmstxt.org): the English docs in the sidebar's groups and order, each page with its frontmatter title
// and description, so the list cannot drift from the docs. The Chinese pages mirror them under /zh/.
type Page = CollectionEntry<"docs">;

// The docs overview's opening paragraph (src/content/docs/docs/index.mdx), without its headline.
const ABOUT = "Each AI coding agent keeps its skills and settings in its own folder. HarnessKit shows all of them in one window: skills, MCP servers, plugins, hooks and CLIs, for every agent. One click adds a skill or MCP server to another agent. A security audit runs on your computer and gives each extension a trust score. Kits save skills, MCP servers and rules as a set you add to a project in one step. HarnessKit is free and open source, and runs as a desktop app, in the terminal, or in a browser.";

/** A directory's pages, its index included, in the order of Starlight's autogenerated groups: `sidebar.order`, then id. */
function pagesIn(pages: Page[], directory: string): Page[] {
const order = (page: Page) => page.data.sidebar.order ?? Number.MAX_VALUE;
return pages.filter(({ id }) => `${id}/`.startsWith(`${directory}/`)).sort((a, b) => order(a) - order(b) || a.id.localeCompare(b.id));
}

export const GET: APIRoute = async ({ site }) => {
const pages = await getCollection("docs");
const link = ({ id, data }: Page) => `- [${data.title}](${new URL(`/${id}/`, site)})${data.description ? `: ${data.description}` : ""}`;
// The sidebar's external link (release notes) is not a docs page, so it gets no section.
const sections = DOCS_SIDEBAR.flatMap(({ label, slug, autogenerate }) => {
const listed = slug ? pages.filter(({ id }) => id === slug) : autogenerate ? pagesIn(pages, autogenerate.directory) : [];
return listed.length ? [`## ${label}\n\n${listed.map(link).join("\n")}`] : [];
});
const chinese = `Each page is also in [Simplified Chinese](${new URL("/zh/docs/", site)}), at the same path under /zh/.`;
return new Response(["# HarnessKit", `> ${en.footer.tagline}`, ABOUT, chinese, ...sections].join("\n\n") + "\n");
};
Loading