docs: set up Astro Starlight site for Read the Docs (#46)
This commit is contained in:
1 parent
dfb1eec557
commit
19eb9f371d
12 files changed
+6909
-23
No files matched your search
+5
-6
@@ -4,18 +4,17 @@
|
||||
# Required
|
||||
version: 2
|
||||
|
||||
# Set the OS, Python version, and other tools you might need
|
||||
# Build the Astro Starlight site under docs/ and hand its output to Read the Docs.
|
||||
build:
|
||||
os: ubuntu-24.04
|
||||
tools:
|
||||
nodejs: "22"
|
||||
|
||||
commands:
|
||||
# Install Docusaurus dependencies
|
||||
- cd docs/ && npm install
|
||||
# Build the site
|
||||
# Install dependencies
|
||||
- cd docs/ && npm ci
|
||||
# Build the site (Astro writes to docs/dist/)
|
||||
- cd docs/ && npm run build
|
||||
# Copy generated files into Read the Docs directory
|
||||
- mkdir --parents $READTHEDOCS_OUTPUT/html/
|
||||
- cp --recursive docs/build/* $READTHEDOCS_OUTPUT/html/
|
||||
|
||||
- cp --recursive docs/dist/* $READTHEDOCS_OUTPUT/html/
|
||||
@@ -0,0 +1,3 @@
|
||||
node_modules/
|
||||
dist/
|
||||
.astro/
|
||||
@@ -0,0 +1,26 @@
|
||||
// @ts-check
|
||||
import { defineConfig } from "astro/config";
|
||||
import starlight from "@astrojs/starlight";
|
||||
|
||||
const canonical = process.env.READTHEDOCS_CANONICAL_URL;
|
||||
const url = canonical ? new URL(canonical) : undefined;
|
||||
|
||||
export default defineConfig({
|
||||
site: url?.origin,
|
||||
base: url?.pathname,
|
||||
integrations: [
|
||||
starlight({
|
||||
title: "OpenMMO",
|
||||
social: [
|
||||
{
|
||||
icon: "github",
|
||||
label: "GitHub",
|
||||
href: "https://github.com/openmmo-org/OpenMMO",
|
||||
},
|
||||
],
|
||||
sidebar: [
|
||||
{ label: "Guides", items: [{ autogenerate: { directory: "guides" } }] },
|
||||
],
|
||||
}),
|
||||
],
|
||||
});
|
||||
@@ -1,6 +0,0 @@
|
||||
# Guides
|
||||
|
||||
How-to guides for working on OpenMMO.
|
||||
|
||||
- [Writing a code generator](writing-generators.md): how to add a new build-time
|
||||
generator that turns pret decomp data into Kotlin game data.
|
||||
@@ -1,10 +0,0 @@
|
||||
# OpenMMO documentation
|
||||
|
||||
Welcome to the OpenMMO docs. This is the starting point for understanding how the
|
||||
project is built and how to work on it.
|
||||
|
||||
## Sections
|
||||
|
||||
- [Guides](guides/index.md): step-by-step how-tos for common tasks.
|
||||
|
||||
More sections will be added over time.
|
||||
Generated
+6821
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "openmmo-docs",
|
||||
"type": "module",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "astro dev",
|
||||
"build": "astro build",
|
||||
"preview": "astro preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/starlight": "^0.41.3",
|
||||
"astro": "^7.1.2",
|
||||
"sharp": "^0.35.3"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { defineCollection } from "astro:content";
|
||||
import { docsLoader } from "@astrojs/starlight/loaders";
|
||||
import { docsSchema } from "@astrojs/starlight/schema";
|
||||
|
||||
export const collections = {
|
||||
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
title: Guides
|
||||
description: How-to guides for working on OpenMMO.
|
||||
---
|
||||
|
||||
How-to guides for working on OpenMMO.
|
||||
|
||||
- [Writing a code generator](writing-generators/): how to add a new
|
||||
build-time generator that turns pret decomp data into Kotlin game data.
|
||||
+4
-1
@@ -1,4 +1,7 @@
|
||||
# Writing a code generator
|
||||
---
|
||||
title: Writing a code generator
|
||||
description: How to add a new build-time generator that turns pret decomp data into Kotlin game data.
|
||||
---
|
||||
|
||||
OpenMMO builds most of its game data (maps, moves, species, …) at compile time.
|
||||
The `:codegen` module reads the raw data files from the pret decomps under
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
title: OpenMMO documentation
|
||||
description: The starting point for understanding how OpenMMO is built and how to work on it.
|
||||
---
|
||||
|
||||
Welcome to the OpenMMO docs. This is the starting point for understanding how the
|
||||
project is built and how to work on it.
|
||||
|
||||
## Sections
|
||||
|
||||
- [Guides](guides/): step-by-step how-tos for common tasks.
|
||||
|
||||
More sections will be added over time.
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"extends": "astro/tsconfigs/strict",
|
||||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
Reference in new issue
Block a user