Skip to content

Commit

Permalink
feat: add math plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
torn4dom4n committed Nov 12, 2023
1 parent b5574aa commit 4da33bd
Show file tree
Hide file tree
Showing 11 changed files with 707 additions and 69 deletions.
52 changes: 7 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,16 @@
# Starlight Starter Kit: Tailwind
# Starlight Tailwind Template

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

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

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

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

## 🚀 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
├── tailwind.config.mjs
└── tsconfig.json
```sh
git clone https://github.com/AREA44/starlight-tailwind-template
cd starlight-tailwind-template
pnpm install
pnpm dev
```

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).
17 changes: 13 additions & 4 deletions astro.config.mjs → astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
import { defineConfig } from 'astro/config'
import starlight from '@astrojs/starlight'
import tailwind from '@astrojs/tailwind'
import remarkMath from 'remark-math'
import rehypeMathJax from 'rehype-mathjax'

// https://astro.build/config
export default defineConfig({
site: process.env.CI ? 'https://area4.github.io' : 'http://localhost:4321',
base: '/starlight-tailwind-template',
experimental: {
contentCollectionCache: true,
// experimental: {
// contentCollectionCache: true,
// },
markdown: {
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeMathJax],
},
integrations: [
starlight({
title: 'Starlight with Tailwind',
customCss: [
'./src/styles/globals.css',
'./src/styles/mathjax.css',
],
social: {
github: 'https://github.com/withastro/starlight',
github: 'https://github.com/AREA44/starlight-tailwind-template',
},
sidebar: [
{
Expand All @@ -25,7 +35,6 @@ export default defineConfig({
autogenerate: { directory: 'reference' },
},
],
customCss: ['./src/styles/globals.css'],
}),
tailwind({ applyBaseStyles: false }),
],
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "starlight-tailwind-template",
"name": "@are44/starlight-tailwind-template",
"version": "0.0.1",
"scripts": {
"build": "astro check && astro build",
Expand All @@ -15,6 +15,8 @@
"@astrojs/tailwind": "^5.0.2",
"astro": "^3.5.3",
"astro-embed": "^0.6.0",
"rehype-mathjax": "^5.0.0",
"remark-math": "^6.0.0",
"sharp": "^0.32.6",
"tailwindcss": "^3.3.5"
},
Expand Down
Loading

0 comments on commit 4da33bd

Please sign in to comment.