Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Sample workflow for building and deploying a VitePress site to GitHub Pages
#
name: Deploy VitePress site to Pages

on:
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
# using the `master` branch as the default branch.
push:
branches: [vitepress]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
# - uses: pnpm/action-setup@v3 # Uncomment this block if you're using pnpm
# with:
# version: 9 # Not needed if you've set "packageManager" in package.json
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm # or pnpm / yarn
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci # or pnpm install / yarn install / bun install
- name: Build with VitePress
run: npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: .vitepress/dist

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.DS_Store
.DS_Store
.vitepress/dist
.vitepress/cache
node_modules/
99 changes: 99 additions & 0 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import { defineConfig } from 'vitepress'
import { scratchblocksPlugin } from 'sb-mdit'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Scratch Specification",
description: "An explanation of Scratch 3.0",
// head: [['link', { rel: 'icon', href: '/favicon.ico' }]], // https://github.com/vuejs/vitepress/discussions/2475#discussioncomment-11238929
base: "/scratch-spec/", // https://vitepress.dev/guide/deploy#setting-a-public-base-path
ignoreDeadLinks: true,
cleanUrls: true,

themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Intro', link: '/intro/' },
{ text: 'Ideas', link: '/ideas/' },
{ text: 'Runtime', link: '/runtime/' },
{ text: 'Blocks', link: '/blocks/' },
{ text: 'Files', link: '/files/' },
{ text: 'I/O', link: '/io/' },
{ text: 'Network', link: '/network/' },
{ text: 'Devices', link: '/devices/' }
],

sidebar: [
{
text: 'Introduction',
link: '/intro/',
items: [
{
text: 'Contribute', link: '/intro/#contributing', collapsed: true, items: [
{ text: 'TODO', link: '/todo/' }
]
},
{ text: 'FAQ', link: '/intro/#faq' },
]
},
{
text: 'Ideas',
link: '/ideas/',
items: [
{ text: 'Concepts', link: '/ideas/concepts/' },
{ text: 'Values', link: '/ideas/values/' },
{ text: 'Limits', link: '/ideas/limits/' },
{ text: 'Logic', link: '/ideas/logic/' }
]
},
{
text: 'Palette',
link: '/blocks/',
items: [
{ text: 'Standard Blocks', link: '/blocks/standard/' },
{ text: 'Obsolete Blocks', link: '/blocks/obsolete/' },
{ text: 'Nonstandard Blocks', link: '/blocks/nonstandard/' }
]
},
{
text: 'File Format',
link: '/files/',
items: [
{ text: 'Scratch 3 (.sb3)', link: '/files/#sb3' },
{ text: 'Scratch 2 (.sb2)', link: '/files/#sb2' },
{ text: 'Scratch 1 (.sb)', link: '/files/#sb' }
]
},
{
text: 'Test Pages',
collapsed: true,
items: [
{ text: 'Single File?', link: '/full/' }
]
}
],

socialLinks: [
{ icon: 'github', link: 'https://github.com/OceanIsEndless/scratch-spec' }
],

search: {
provider: 'local'
},

outline: {
level: [1, 6],
label: 'Contents'
}
},

markdown: {
math: true,
toc: { level: [1, 2, 3, 4, 5, 6] },
config: (md) => {
md.use(scratchblocksPlugin) // https://github.com/OceanIsEndless/scratch-spec/pull/5#issuecomment-3137259965
// May add more if needed
}
}
})
Loading