Skip to content

Commit e0e8483

Browse files
committed
docs with vitepress and github pages
1 parent 26042bf commit e0e8483

File tree

11 files changed

+3500
-13841
lines changed

11 files changed

+3500
-13841
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy docs to github pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: ["vitepress"]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow one concurrent deployment
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: true
21+
22+
jobs:
23+
# Single deploy job since we're just deploying
24+
deploy:
25+
environment:
26+
name: github-pages
27+
url: ${{ steps.deployment.outputs.page_url }}
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v5
32+
- name: Set up Node
33+
uses: actions/setup-node@v6
34+
with:
35+
node-version: lts/*
36+
cache: "npm"
37+
- name: Install dependencies
38+
run: npm install
39+
- name: Build
40+
run: npm run typedoc && npm run docs:build
41+
- name: Setup Pages
42+
uses: actions/configure-pages@v5
43+
- name: Upload artifact
44+
uses: actions/upload-pages-artifact@v4
45+
with:
46+
# Upload dist folder
47+
path: "./dist"
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# build
22
dist/
33

4+
# typedoc
5+
docs/pages/api/
6+
47
# misc
58
.DS_Store
69
*.pem
@@ -41,3 +44,8 @@ docs/dist/*
4144
# typescript
4245
*.tsbuildinfo
4346
next-env.d.ts
47+
48+
# VitePress
49+
docs/.vitepress/cache/
50+
docs/.vitepress/dist/
51+
docs/.vitepress/.temp/

docs/.vitepress/config.ts

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import { defineConfig } from "vitepress";
2+
3+
// https://vitepress.dev/reference/site-config
4+
export default defineConfig({
5+
title: "Stage.js Docs",
6+
description: "2D JavaScript library for cross-platform HTML5 game development",
7+
srcDir: "./pages",
8+
base: "/stage.js/docs/",
9+
outDir: "../dist/docs",
10+
themeConfig: {
11+
// https://vitepress.dev/reference/default-theme-config
12+
search: {
13+
provider: "local",
14+
},
15+
// nav: [
16+
// { text: "GitHub", link: "https://github.com/piqnt/stage.js" },
17+
// { text: "Discord", link: "https://discord.gg/7B5e7MXFxQ" },
18+
// ],
19+
socialLinks: [
20+
{ icon: "github", link: "https://github.com/piqnt/stage.js" },
21+
{ icon: "discord", link: "https://discord.gg/7B5e7MXFxQ" },
22+
],
23+
sidebar: [
24+
{
25+
text: "Getting Started",
26+
collapsed: true,
27+
items: [
28+
{ text: "Introduction", link: "/" },
29+
{ text: "Install", link: "/install" },
30+
{ text: "Hello World", link: "/hello-world" },
31+
],
32+
},
33+
{
34+
text: "Core",
35+
collapsed: true,
36+
items: [
37+
{ text: "Setup", link: "/setup" },
38+
{ text: "Game Loop", link: "/loop" },
39+
{ text: "Events and Pointer", link: "/events" },
40+
],
41+
},
42+
{
43+
text: "Texture",
44+
collapsed: true,
45+
items: [
46+
{ text: "Texture", link: "/texture" },
47+
{ text: "Atlas", link: "/atlas" },
48+
{ text: "Sprite Component", link: "/sprite" },
49+
{ text: "Anim Component", link: "/anim" },
50+
{ text: "Monotype Component", link: "/monotype" },
51+
],
52+
},
53+
{
54+
text: "Layout",
55+
collapsed: true,
56+
items: [
57+
{ text: "Component Tree", link: "/tree" },
58+
{ text: "Pin", link: "/pin" },
59+
{ text: "Transition", link: "/transition" },
60+
{ text: "Layout Components", link: "/layout" },
61+
],
62+
},
63+
{ text: "API Reference", link: "/api/" },
64+
{
65+
text: "What's new?",
66+
collapsed: false,
67+
items: [{ text: "v1.0 - Work in Progress", link: "/news/v1.0" }],
68+
},
69+
],
70+
},
71+
});

0 commit comments

Comments
 (0)