Skip to content

Commit ae0320d

Browse files
authored
Merge pull request #35 from menloresearch/rp/docs-updates
docs: add navigation system for Jan Browser Extension docs
2 parents ea69ce5 + aa5e0ca commit ae0320d

15 files changed

+540
-27
lines changed

docs/README.md

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,65 @@
1-
# Jan's Website
1+
# Jan Browser Extension Documentation
22

3-
This website is [built with Starlight](https://starlight.astro.build)
3+
This documentation site is built with [Starlight](https://starlight.astro.build) and mirrors the main [Jan documentation](https://docs.jan.ai) structure for consistency across the Jan ecosystem.
44

5+
## 🎯 For Jan Browser Extension Developers
56

6-
Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed
7-
as a route based on its file name.
7+
**Focus Area**: Work primarily in `./docs/src/content/docs/browser/` - this is where all Jan Browser Extension-specific documentation lives.
88

9-
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
9+
The navigation automatically routes to the main Jan docs:
10+
- **"Docs"**`https://docs.jan.ai`
11+
- **"API Reference"**`https://docs.jan.ai/api`
1012

11-
Static assets, like favicons, can be placed in the `public/` directory.
13+
### Adding New Documentation
1214

13-
If you want to add new pages, these can go in the `src/pages/` directory. Because of the topics plugin
14-
we are using ([starlight sidebar topics](https://starlight-sidebar-topics.netlify.app/docs/guides/excluded-pages/))
15-
you will need to exclude them from the sidebar by adding them to the exclude list in `astro.config.mjs`, e.g., `exclude: ['/example'],`.
15+
1. **Create files** in `./docs/src/content/docs/browser/`
16+
2. **Update sidebar** in `astro.config.mjs` under the "Browser Extension" section:
17+
18+
```js
19+
{
20+
label: "Browser Extension",
21+
items: [
22+
{ label: "Overview", slug: "browser" },
23+
{ label: "Your New Page", slug: "browser/your-new-page" }, // Add here
24+
// ... existing items
25+
],
26+
}
27+
```
1628

1729
## 🧞 Commands
1830

19-
All commands are run from the root of the project, from a terminal:
31+
All commands run from the `./docs/` directory:
32+
33+
| Command | Action |
34+
| :-------------------- | :---------------------------------------- |
35+
| `bun install` | Install dependencies |
36+
| `bun dev` | Start dev server at `localhost:4321` |
37+
| `bun build` | Build production site to `./dist/` |
38+
| `bun preview` | Preview build locally |
39+
40+
**⚠️ Important**: After running `bun dev`, manually navigate to `http://localhost:4321/browser/` since the main index page doesn't exist in this repo (it's in the main Jan repository).
41+
42+
## 📁 Structure
43+
44+
```
45+
docs/
46+
├── src/content/docs/
47+
│ └── browser/ ← Your work goes here
48+
├── astro.config.mjs ← Update sidebar here
49+
└── public/
50+
├── scripts/
51+
└── styles/
52+
```
53+
54+
## 🔗 Navigation
55+
56+
The site automatically includes navigation that links back to the main Jan documentation ecosystem. This ensures users can easily move between Jan Desktop docs, API Reference, and Jan Browser Extension docs.
57+
58+
## 📝 Writing Guidelines
59+
60+
- Use clear, concise language
61+
- Include code examples where helpful
62+
- Follow the existing documentation patterns from the main Jan docs
63+
- Test your changes with `bun dev` before committing
2064

21-
| Command | Action |
22-
| :------------------------ | :----------------------------------------------- |
23-
| `bun install` | Installs dependencies |
24-
| `bun dev` | Starts local dev server at `localhost:4321` |
25-
| `bun build` | Build your production site to `./dist/` |
26-
| `bun preview` | Preview your build locally, before deploying |
27-
| `bun astro ...` | Run CLI commands like `astro add`, `astro check` |
28-
| `bun astro -- --help` | Get help using the Astro CLI |
65+
For questions about the documentation structure or navigation, refer to the main [Jan documentation repository](https://github.com/menloresearch/jan).

docs/astro.config.mjs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,16 @@ export default defineConfig({
2424
}),
2525
starlight({
2626
title: "👋 Jan",
27-
favicon: "jan2.png",
27+
favicon: "favicon.ico",
28+
customCss: ["./src/styles/global.css"],
2829
head: [
2930
{
3031
tag: "script",
31-
content: `
32-
document.addEventListener('DOMContentLoaded', function() {
33-
const logoLink = document.querySelector('a[href="/"]');
34-
if (logoLink) {
35-
logoLink.href = 'https://jan.ai';
36-
}
37-
});
38-
`,
32+
attrs: { src: "/scripts/inject-navigation.js", defer: true },
33+
},
34+
{
35+
tag: "link",
36+
attrs: { rel: "stylesheet", href: "/styles/navigation.css" },
3937
},
4038
],
4139
plugins: [
93.8 KB
Binary file not shown.
89.3 KB
Binary file not shown.
91 KB
Binary file not shown.
93.3 KB
Binary file not shown.
92.6 KB
Binary file not shown.
94.5 KB
Binary file not shown.
90.3 KB
Binary file not shown.

docs/public/favicon.ico

15 KB
Binary file not shown.

0 commit comments

Comments
 (0)