Skip to content

Commit

Permalink
Switch documentation website from Nuxt to Astro (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvinus authored Sep 26, 2023
1 parent 6a28c52 commit 7013cd9
Show file tree
Hide file tree
Showing 36 changed files with 2,914 additions and 6,730 deletions.
9 changes: 3 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
/tags
/dist

# Documentation dependencies and artefacts
/docs/dist
/docs/node_modules
/docs/.output
/docs/.nuxt
/docs/static/sw.js
/docs/src/content/docs/changelog.md

.idea
.vscode

# Examples data directories
examples/*/resources/chproxy/data
Expand Down
3 changes: 0 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
---
title: Changelog
menuTitle: Changelog
category: Guides
position: 104
---

Since v1.17.1, chproxy follows [semantic versioning](https://semver.org/).
Expand Down
21 changes: 21 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
65 changes: 42 additions & 23 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,53 @@
# Chproxy documentation
# Starlight Starter Kit: Basics

The documentation website is build with Nuxt and the official docs theme.
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)

It is automatically deployed on each commit on the `main` branch, through
Render.
```
npm create astro@latest -- --template starlight
```

# CONTRIBUTING
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics)

## Ordering links in the sidebar
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
Each page should be given a unique `position`, that will determine where it will
be positioned in the sidebar. Each page can also have a `category`, to group
similar pages together.
## 🚀 Project Structure

Note that the `position` is relative to the top of the sidebar, not to the top
of the parent category.
Inside of your Astro + Starlight project, you'll see the following folders and files:

**Tip:** Span `position` values on various hundreds, so you can more easily
reorder links in a given category. For example, all links in the first category
should be `101`, `102`, etc and links in the third category should be `301`,
`302`, etc.
```
.
├── public/
├── src/
│ ├── assets/
│ ├── content/
│ │ ├── docs/
│ │ └── config.ts
│ └── env.d.ts
├── astro.config.mjs
├── package.json
└── tsconfig.json
```

Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.

Images can be added to `src/assets/` and embedded in Markdown with a relative link.

## TODO:
Static assets, like favicons, can be placed in the `public/` directory.

- Configure Render for deployment
- Configure Render for Pull Requests
- Can we make it smart and only re-render if changes in the docs, not if
changes in the code?
- Configure Algolia DocSearch
- Need to add a logo
- Replace the manual copy/paste of files with dynamic links
## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |

## 👀 Want to learn more?

Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).
194 changes: 0 additions & 194 deletions docs/assets/css/main.css

This file was deleted.

63 changes: 63 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';

// https://astro.build/config
export default defineConfig({
site: 'https://www.chproxy.org',
integrations: [
starlight({
title: 'Chproxy',
description: 'Chproxy is an HTTP proxy and load balancer for ClickHouse',
social: {
github: 'https://github.com/ContentSquare/chproxy',
twitter: 'https://twitter.com/contentsquarerd'
},
editLink: {
baseUrl: 'https://github.com/ContentSquare/chproxy/edit/master/docs/',
},
logo: {
dark: './src/assets/logo-white.svg',
light: './src/assets/logo-black.svg',
replacesTitle: true,
},
customCss: [
// Relative path to your custom CSS file
'./src/styles/custom.css',
],
defaultLocale: 'root',
locales: {
// English docs in `src/content/docs/en/`
root: {
label: 'English',
lang: 'en'
},
// Simplified Chinese docs in `src/content/docs/zh/`
cn: {
label: '简体中文',
lang: 'zh-CN',
}
},
sidebar: [
{
label: 'Guides',
items: [
{ label: 'Introduction', link: '/' },
{ label: 'Installation', link: '/install/' },
{ label: 'Quick start', link: '/getting_started/' },
{ label: 'Changelog', link: '/changelog/' },
{ label: 'History', link: '/history/' },
{ label: 'FAQ', link: '/faq/' }
],
},
{
label: 'Configuration',
autogenerate: { directory: 'configuration' }
},
{
label: 'Use cases',
autogenerate: { directory: 'use-cases' }
},
],
}),
],
});
1 change: 0 additions & 1 deletion docs/content/en/changelog.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/content/settings.json

This file was deleted.

Loading

0 comments on commit 7013cd9

Please sign in to comment.