Skip to content

Commit c383572

Browse files
authored
Merge pull request #23 from SkwalExe/docs
Add base for VitePress documentation
2 parents 98e2d1b + b106743 commit c383572

File tree

7 files changed

+1388
-0
lines changed

7 files changed

+1388
-0
lines changed

.github/workflows/docs_deploy.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Deploy VitePress site to Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
10+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
17+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
18+
concurrency:
19+
group: pages
20+
cancel-in-progress: false
21+
22+
defaults:
23+
run:
24+
working-directory: docs/
25+
26+
jobs:
27+
# Build job
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
35+
- uses: pnpm/action-setup@v3 # Uncomment this if you're using pnpm
36+
with:
37+
version: 9
38+
run_install: |
39+
- cwd: "docs/"
40+
- name: Setup Node
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 20
44+
cache: pnpm
45+
cache-dependency-path: docs/package.json
46+
- name: Setup Pages
47+
uses: actions/configure-pages@v4
48+
- name: Install dependencies
49+
run: pnpm install
50+
- name: Build with VitePress
51+
run: pnpm run build
52+
- name: Upload artifact
53+
uses: actions/upload-pages-artifact@v3
54+
with:
55+
path: docs/.vitepress/dist
56+
57+
# Deployment job
58+
deploy:
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
needs: build
63+
runs-on: ubuntu-latest
64+
name: Deploy
65+
steps:
66+
- name: Deploy to GitHub Pages
67+
id: deployment
68+
uses: actions/deploy-pages@v4

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
cache/
12
node_modules/
23
dist/

docs/.vitepress/config.mts

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { defineConfig } from 'vitepress'
2+
3+
// https://vitepress.dev/reference/site-config
4+
export default defineConfig({
5+
title: 'WinMB.js',
6+
description:
7+
'Non-serious library allowing you to effortlessly bring windows dialogue boxes to your webpages!',
8+
srcDir: 'src',
9+
themeConfig: {
10+
// https://vitepress.dev/reference/default-theme-config
11+
nav: [
12+
{ text: 'Home', link: '/' },
13+
{ text: 'Getting Started', link: '/getting-started' }
14+
],
15+
outline: 'deep',
16+
footer: {
17+
message: 'Released under the GNU General Public License (GPLv3).',
18+
copyright: 'Copyright © 2021-present Léopold Koprivnik'
19+
},
20+
search: {
21+
provider: 'local'
22+
},
23+
editLink: {
24+
pattern: 'https://github.com/skwalexe/WinMB.js/edit/main/docs/src/:path'
25+
},
26+
sidebar: [
27+
{
28+
text: 'Introduction',
29+
items: [{ text: '📥 Getting Started', link: '/getting-started' }]
30+
}
31+
],
32+
33+
socialLinks: [{ icon: 'github', link: 'https://github.com/skwalexe/WinMB.js' }]
34+
},
35+
head: [
36+
[
37+
'script',
38+
{
39+
src: 'https://cdn.jsdelivr.net/npm/@skwalexe/[email protected]/dist/winmb.umd.js'
40+
}
41+
]
42+
]
43+
})

docs/package.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"devDependencies": {
3+
"vitepress": "^1.3.1"
4+
},
5+
"scripts": {
6+
"dev": "vitepress dev",
7+
"build": "vitepress build",
8+
"preview": "vitepress preview"
9+
}
10+
}

0 commit comments

Comments
 (0)