Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaitanLyss committed Aug 7, 2024
0 parents commit 3f3fbc4
Show file tree
Hide file tree
Showing 16 changed files with 259 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .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
4 changes: 4 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Starlight Starter Kit: Basics
## Configuration

[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)

```
npm create astro@latest -- --template starlight
```

[![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)
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/basics)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fbasics&project-name=my-starlight-docs&repository-name=my-starlight-docs)

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
## 🚀 Project Structure

Inside of your Astro + Starlight project, you'll see the following folders and files:

```
.
├── 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.

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

## 🧞 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).
45 changes: 45 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import { loadEnv } from 'vite';

const { SITE_URL = 'http://localhost:4444' } = loadEnv(process.env.NODE_ENV, process.cwd(), "");
// https://astro.build/config
export default defineConfig({
site: SITE_URL,
// prefetch: true,
integrations: [
starlight({
title: 'Selenite Docs',
social: {
github: 'https://github.com/withastro/starlight',
},
sidebar: [
{
label: 'Guides',
items: [
// Each item here is one entry in the navigation menu.
{ label: 'Getting started', slug: 'guides/getting-started' },
],
},
{
label: 'Reference',
autogenerate: { directory: 'reference' },
},
],
defaultLocale: 'root',
locales: {
root: {
label: 'English',
lang: 'en'
},
fr: {
label: 'Français',
}
}
}),
],
server: {
port: 4444,
host: true
}
});
Binary file added bun.lockb
Binary file not shown.
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "docs",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/starlight": "^0.25.4",
"astro": "^4.10.2",
"sharp": "^0.32.5",
"@astrojs/check": "^0.9.2",
"typescript": "^5.5.4"
},
"devDependencies": {
"vite": "^5.3.5"
}
}
1 change: 1 addition & 0 deletions public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/houston.webp
Binary file not shown.
6 changes: 6 additions & 0 deletions src/content/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineCollection } from 'astro:content';
import { docsSchema } from '@astrojs/starlight/schema';

export const collections = {
docs: defineCollection({ schema: docsSchema() }),
};
24 changes: 24 additions & 0 deletions src/content/docs/fr/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: Bienvenue sur Selenite
description: Get started building your docs site with Starlight.
template: splash
hero:
tagline: <h2>
Outils pour GEOS et la geoscience
</h2>
<p class="">
GEOS est un logiciel complexe, Selenite vise à simplifier son utilisation.
</p>
# image:
# file: ../../assets/houston.webp
actions:
- text: Démarrage
link: /fr/guides/getting-started
icon: right-arrow
variant: primary
- text: Documentation de GEOS
link: https://geosx-geosx.readthedocs-hosted.com/en/latest/
icon: external
---

import { Card, CardGrid } from '@astrojs/starlight/components';
11 changes: 11 additions & 0 deletions src/content/docs/guides/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Getting started
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
42 changes: 42 additions & 0 deletions src/content/docs/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Welcome to Selenite
description: Get started building your docs site with Starlight.
template: splash
hero:
tagline: <h2>
Tools for GEOS and geoscience
</h2>
<p class="">
GEOS is a complex software, Selenite aims to simplify its
use.
</p>
# image:
# file: ../../assets/houston.webp
actions:
- text: Getting Started
link: /guides/getting-started
icon: right-arrow
variant: primary
- text: Read the GEOS docs
link: https://geosx-geosx.readthedocs-hosted.com/en/latest/
icon: external
---

import { Card, CardGrid } from '@astrojs/starlight/components';

## Next steps

<CardGrid stagger>
<Card title="Update content" icon="pencil">
Edit `src/content/docs/index.mdx` to see this page change.
</Card>
<Card title="Add new content" icon="add-document">
Add Markdown or MDX files to `src/content/docs` to create new pages.
</Card>
<Card title="Configure your site" icon="setting">
Edit your `sidebar` and other config in `astro.config.mjs`.
</Card>
<Card title="Read the docs" icon="open-book">
Learn more in [the Starlight Docs](https://starlight.astro.build/).
</Card>
</CardGrid>
11 changes: 11 additions & 0 deletions src/content/docs/reference/example.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "astro/tsconfigs/strict"
}

0 comments on commit 3f3fbc4

Please sign in to comment.