Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move docs to Starlight with AstroJS #112

Merged
merged 14 commits into from
Oct 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
124 changes: 16 additions & 108 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,116 +1,24 @@
# Logs
logs
*.log
# build output
dist/
# generated types
.astro/
# package lock file used for production
package-lock.json

# dependencies
node_modules/

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

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo
pnpm-debug.log*

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
# environment variables
.env
.env.test
.env.local
.env.development.local
.env.test.local
.env.production.local

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Docusaurus files
/build
.docusaurus
.cache-loader
.env.production

# Misc
# macOS-specific files
.DS_Store
.vercel
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

54 changes: 41 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,53 @@
# AstroNvim Website
# Starlight Starter Kit: Basics

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

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

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

### Local Development
[![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)

```
$ yarn start
```
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
## 🚀 Project Structure

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

```
$ yarn build
.
├── public/
├── src/
│ ├── assets/
│ ├── content/
│ │ ├── docs/
│ │ └── config.ts
│ └── env.d.ts
├── astro.config.mjs
├── package.json
└── tsconfig.json
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
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).
140 changes: 140 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";

import tailwind from "@astrojs/tailwind";

const locales = {
root: {
label: "English",
lang: "en", // lang is required for root locales
},
};

// https://astro.build/config
export default defineConfig({
site: "https://docs.astronvim.com",
defaultLocale: "root",
locales,
integrations: [
starlight({
title: "AstroNvim",
description: "The documentation website for AstroNvim.",
favicon: "/astronvim.svg",
head: [
{
tag: "link",
attrs: {
rel: "icon",
href: "https://astronvim.com/logo/astronvim.svg",
size: "image/svg+xml",
},
},
{
tag: "link",
attrs: {
rel: "icon",
href: "https://astronvim.com/logo/favicon.ico",
size: "any",
},
},
{
tag: "link",
attrs: {
rel: "apple-touch-icon",
href: "https://astronvim.com/logo/apple-touch-icon.png",
},
},
{
tag: "link",
attrs: {
rel: "manifest",
href: "/manifest.webmanifest",
},
},
{
tag: "script",
attrs: {
src: "https://plausible.mehalter.com/js/script.js",
defer: true,
"data-domain": "docs.astronvim.com",
},
},
],
logo: {
src: "./src/assets/astronvim.svg",
},
customCss: [
// Path to your Tailwind base styles:
"./src/tailwind.css",
],
social: {
mastodon: "https://hachyderm.io/@AstroNvim",
"x.com": "https://x.com/AstroNvim",
discord: "https://discord.astronvim.com",
github: "https://git.astronvim.com/AstroNvim",
// reddit: "https://www.reddit.com/r/AstroNvim",
},
sidebar: [
{
label: "Getting started",
link: "/",
collapsed: true,
translations: {},
},
{
label: "Basic Usage",
collapsed: true,
autogenerate: {
directory: "basic-usage",
},
translations: {},
},
{
label: "Configuration",
collapsed: true,
autogenerate: {
directory: "Configuration",
},
translations: {},
},
{
label: "Recipes",
collapsed: true,
autogenerate: {
directory: "Recipes",
},
translations: {},
},
{
label: "Acknowledgements",
link: "/acknowledgements",
collapsed: true,

translations: {},
},
{
label: "Code of Conduct",
collapsed: true,
link: "/code_of_conduct",
translations: {},
},
{
label: "Frequently asked questions",
collapsed: true,
link: "/faq",
translations: {},
},
{
label: "Core Lua API Documentation",
link: "https://api.astronvim.com",
translations: {},
},
],
lastUpdated: true,
}),
tailwind({
// Disable the default base styles:
applyBaseStyles: false,
}),
],
});
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

Loading