Skip to content

Commit a5d5294

Browse files
committed
adds docusarus doc site
1 parent 296a1d4 commit a5d5294

25 files changed

+15367
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Build Docusaurus
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Use Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: "20.x"
18+
- run: npm ci
19+
- run: npm run build
20+
- run: npm run api-report
21+
- run: npm run docs:api-report
22+
- run: cd docs-site
23+
- name: Install dependencies
24+
run: npm ci
25+
- name: Build website
26+
run: npm build
27+
28+
- name: Upload Build Artifact
29+
uses: actions/upload-pages-artifact@v3
30+
with:
31+
path: build
32+
33+
deploy:
34+
name: Deploy to GitHub Pages
35+
needs: build
36+
37+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
38+
permissions:
39+
pages: write # to deploy to Pages
40+
id-token: write # to verify the deployment originates from an appropriate source
41+
42+
# Deploy to the github-pages environment
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- run: npm ci
3636
- run: npm run build
3737
- run: npm run api-report
38-
- run: npm run docs
38+
- run: npm run docs:api-report
3939
- name: Setup Pages
4040
uses: actions/configure-pages@v3
4141
- name: Build Pages

doc-site/.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
api-reference
11+
12+
# Misc
13+
.DS_Store
14+
.env.local
15+
.env.development.local
16+
.env.test.local
17+
.env.production.local
18+
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*

doc-site/babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

doc-site/docs/intro.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Tutorial Intro WOO
6+
7+
Let's discover **Docusaurus in less than 5 minutes**.
8+
9+
## Getting Started
10+
11+
Get started by **creating a new site**.
12+
13+
Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
14+
15+
### What you'll need
16+
17+
- [Node.js](https://nodejs.org/en/download/) version 18.0 or above:
18+
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
19+
20+
## Generate a new site
21+
22+
Generate a new Docusaurus site using the **classic template**.
23+
24+
The classic template will automatically be added to your project after you run the command:
25+
26+
```bash
27+
npm init docusaurus@latest my-website classic
28+
```
29+
30+
You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.
31+
32+
The command also installs all necessary dependencies you need to run Docusaurus.
33+
34+
## Start your site
35+
36+
Run the development server:
37+
38+
```bash
39+
cd my-website
40+
npm run start
41+
```
42+
43+
The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.
44+
45+
The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.
46+
47+
Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.

doc-site/docusaurus.config.ts

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import { themes as prismThemes } from "prism-react-renderer";
2+
import type { Config } from "@docusaurus/types";
3+
import * as Preset from "@docusaurus/preset-classic";
4+
5+
const config: Config = {
6+
title: "Design Token Library",
7+
tagline: "A TypeScript library for managing Design Token Libraries",
8+
favicon: "img/favicon.ico",
9+
10+
// Set the production url of your site here
11+
url: "https://nicholasrice.github.io",
12+
// Set the /<baseUrl>/ pathname under which your site is served
13+
// For GitHub pages deployment, it is often '/<projectName>/'
14+
baseUrl: "/design-token-library/",
15+
16+
// GitHub pages deployment config.
17+
// If you aren't using GitHub pages, you don't need these.
18+
organizationName: "nicholasrice", // Usually your GitHub org/user name.
19+
projectName: "design-token-library", // Usually your repo name.
20+
21+
onBrokenLinks: "throw",
22+
onBrokenMarkdownLinks: "warn",
23+
24+
// Even if you don't use internationalization, you can use this field to set
25+
// useful metadata like html lang. For example, if your site is Chinese, you
26+
// may want to replace "en" with "zh-Hans".
27+
i18n: {
28+
defaultLocale: "en",
29+
locales: ["en"],
30+
},
31+
32+
presets: [
33+
[
34+
"classic",
35+
{
36+
docs: {
37+
sidebarPath: "./sidebars.ts",
38+
},
39+
theme: {
40+
customCss: "./src/css/custom.css",
41+
},
42+
} satisfies Preset.Options,
43+
],
44+
],
45+
46+
themeConfig: {
47+
navbar: {
48+
title: "Design Token Library",
49+
items: [
50+
{
51+
type: "docSidebar",
52+
sidebarId: "tutorialSidebar",
53+
position: "left",
54+
label: "Docs",
55+
},
56+
{
57+
sidebarId: "apiSidebar",
58+
position: "left",
59+
label: "API Reference",
60+
to: "docs/api-reference/design-token-library",
61+
},
62+
{
63+
href: "https://github.com/nicholasrice/design-token-library",
64+
position: "right",
65+
},
66+
],
67+
},
68+
footer: {
69+
style: "dark",
70+
copyright: `Copyright © ${new Date().getFullYear()}. Built with Docusaurus.`,
71+
},
72+
prism: {
73+
theme: prismThemes.github,
74+
darkTheme: prismThemes.dracula,
75+
},
76+
} satisfies Preset.ThemeConfig,
77+
};
78+
79+
export default config;

0 commit comments

Comments
 (0)