Skip to content

Commit

Permalink
Adopt Astro Starlight template for docs website (#189)
Browse files Browse the repository at this point in the history
* feat: adopt astro starlight

* chore: remove website npm lockfile

* docs: fix markdown
  • Loading branch information
morellodev authored Oct 29, 2023
1 parent f5a7c82 commit dbe1cb1
Show file tree
Hide file tree
Showing 39 changed files with 2,724 additions and 1,967 deletions.
2 changes: 0 additions & 2 deletions packages/website/.eslintignore

This file was deleted.

38 changes: 0 additions & 38 deletions packages/website/.eslintrc.json

This file was deleted.

7 changes: 2 additions & 5 deletions packages/website/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# build output
dist/
.output/
# generated types
.astro/

# dependencies
node_modules/
Expand All @@ -11,13 +12,9 @@ yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store

# generated content
.astro
6 changes: 0 additions & 6 deletions packages/website/.lintstagedrc.mjs

This file was deleted.

55 changes: 31 additions & 24 deletions packages/website/README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,53 @@
# Welcome to [Astro](https://astro.build)
# Starlight Starter Kit: Basics

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
[![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)

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

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

```
/
.
├── public/
│ └── favicon.svg
├── src/
│ ├── components/
│ │ └── Card.astro
│ ├── layouts/
│ │ └── Layout.astro
│ └── pages/
│ └── index.astro
└── package.json
│ ├── assets/
│ ├── content/
│ │ ├── docs/
│ │ └── config.ts
│ └── env.d.ts
├── astro.config.mjs
├── package.json
└── tsconfig.json
```

Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
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.

There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
Images can be added to `src/assets/` and embedded in Markdown with a relative link.

Any static assets, like images, can be placed in the `public/` directory.
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:3000` |
| `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 preview` |
| `npm run astro --help` | Get help using the Astro CLI |
| 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?

Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
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).
24 changes: 24 additions & 0 deletions packages/website/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";

// https://astro.build/config
export default defineConfig({
site: "https://react-awesome-reveal.morello.dev",
integrations: [
starlight({
title: "React Awesome Reveal",
social: {
email: "mailto:[email protected]",
github: "https://github.com/morellodev/react-awesome-reveal",
linkedin: "https://www.linkedin.com/in/dennismorello",
"x.com": "https://x.com/morellodev",
},
sidebar: [
{
label: "Guides",
autogenerate: { directory: "guides" },
},
],
}),
],
});
23 changes: 0 additions & 23 deletions packages/website/astro.config.ts

This file was deleted.

27 changes: 9 additions & 18 deletions packages/website/package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
{
"name": "website",
"type": "module",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro",
"lint": "eslint .",
"lint:fix": "eslint --fix ."
},
"devDependencies": {
"@astrojs/sitemap": "^1.2.2",
"@astrojs/tailwind": "^3.1.2",
"@fec/remark-a11y-emoji": "^3.1.0",
"@tailwindcss/typography": "^0.5.9",
"astro": "^2.3.4",
"eslint-plugin-tailwindcss": "^3.11.0",
"rehype-external-links": "^2.0.1",
"rehype-slug": "^5.1.0",
"remark-emoji": "^3.1.1",
"tailwindcss": "^3.3.2"
"astro": "astro"
},
"dependencies": {
"astro-icon": "^0.8.0",
"fp-ts": "^2.14.0"
"@astrojs/check": "^0.2.1",
"@astrojs/starlight": "^0.11.2",
"astro": "^3.2.3",
"sharp": "^0.32.5",
"typescript": "^5.2.2"
}
}
39 changes: 0 additions & 39 deletions packages/website/plugins/rehypeExternalLinks.ts

This file was deleted.

Binary file removed packages/website/public/fonts/Hubot-Sans.woff2
Binary file not shown.
Binary file removed packages/website/public/fonts/Mona-Sans.woff2
Binary file not shown.
8 changes: 7 additions & 1 deletion packages/website/public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# *
User-agent: *
Allow: /
Sitemap: https://react-awesome-reveal.morello.dev/sitemap-index.xml

# Host
Host: https://react-awesome-reveal.morello.dev

# Sitemaps
Sitemap: https://react-awesome-reveal.morello.dev/sitemap-index.xml
Binary file added packages/website/src/assets/houston.webp
Binary file not shown.
52 changes: 0 additions & 52 deletions packages/website/src/components/BaseHead.astro

This file was deleted.

25 changes: 0 additions & 25 deletions packages/website/src/components/BlurredBackground.astro

This file was deleted.

17 changes: 0 additions & 17 deletions packages/website/src/components/Container.astro

This file was deleted.

Loading

1 comment on commit dbe1cb1

@vercel
Copy link

@vercel vercel bot commented on dbe1cb1 Oct 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.