Skip to content

Commit 0fc0074

Browse files
committed
github pages site
1 parent 7a95175 commit 0fc0074

32 files changed

Lines changed: 20327 additions & 7346 deletions

.github/workflows/pages.yml

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

docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.cache/
2+
public

docs/gatsby-config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @type {import('gatsby').GatsbyConfig}
3+
*/
4+
module.exports = {
5+
siteMetadata: {
6+
title: `@wq/material`,
7+
siteUrl: `https://material.wq.io`,
8+
},
9+
plugins: [
10+
"gatsby-plugin-emotion",
11+
"gatsby-plugin-mdx",
12+
{
13+
resolve: "gatsby-source-filesystem",
14+
options: {
15+
name: "pages",
16+
path: "./src/pages/",
17+
},
18+
__key: "pages",
19+
},
20+
],
21+
};

docs/package.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "@wq/material-docs",
3+
"version": "0.0.1",
4+
"private": true,
5+
"description": "@wq/material docs",
6+
"author": "S. Andrew Sheppard",
7+
"keywords": [
8+
"gatsby"
9+
],
10+
"scripts": {
11+
"develop": "gatsby develop",
12+
"start": "gatsby develop",
13+
"build": "gatsby build",
14+
"serve": "gatsby serve",
15+
"clean": "gatsby clean"
16+
},
17+
"dependencies": {
18+
"@emotion/react": "^11.14.0",
19+
"@emotion/styled": "^11.14.1",
20+
"@wq/gatsby-components": "^0.1.0",
21+
"@wq/material-web": "^3.0.0-alpha.0",
22+
"gatsby": "^5.14.6",
23+
"gatsby-plugin-emotion": "^8.15.0",
24+
"gatsby-plugin-mdx": "^5.15.0",
25+
"gatsby-source-filesystem": "^5.15.0",
26+
"react": "^18.2.0",
27+
"react-dom": "^18.2.0"
28+
}
29+
}

docs/src/components/Layout.jsx

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import React from "react";
2+
import {
3+
Root,
4+
Container,
5+
Header,
6+
Main,
7+
Footer,
8+
NavMenuFixed,
9+
} from "@wq/material";
10+
import {
11+
NavMenu,
12+
Content,
13+
usePageTitle,
14+
useNav,
15+
useReverse,
16+
useRouteInfo,
17+
useBreadcrumbs,
18+
} from "@wq/gatsby-components";
19+
import { Link } from "gatsby";
20+
import { Info, Javascript as NpmPackage } from "@mui/icons-material";
21+
import "./styles.css";
22+
23+
const config = {
24+
site_title: "@wq/material",
25+
logo: "https://wq.io/images/icons/wq.svg",
26+
};
27+
28+
const components = {
29+
NavLink: Link,
30+
NavMenu,
31+
useNav,
32+
useReverse,
33+
useRouteInfo,
34+
useBreadcrumbs,
35+
};
36+
37+
const icons = {
38+
Info,
39+
NpmPackage,
40+
};
41+
42+
const overrides = { config, components, icons };
43+
44+
const theme = {
45+
primary: "#7500ae",
46+
secondary: "#0088bd",
47+
};
48+
49+
export default function Layout({ children, ...rest }) {
50+
return (
51+
<Root wq={overrides} theme={theme}>
52+
<Container>
53+
<Header />
54+
<Main>
55+
<NavMenuFixed />
56+
<Content>{children}</Content>
57+
</Main>
58+
<Footer />
59+
</Container>
60+
</Root>
61+
);
62+
}
63+
64+
export function Head() {
65+
const pageTitle = usePageTitle();
66+
return (
67+
<>
68+
<title>
69+
{pageTitle} - {overrides.config.site_title}
70+
</title>
71+
</>
72+
);
73+
}

docs/src/components/styles.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.MuiAppBar-colorPrimary img {
2+
border-radius: 4px;
3+
padding: 4px;
4+
margin-left: -18px !important;
5+
margin-top: 4px;
6+
margin-bottom: 4px;
7+
background-color: rgba(0, 0, 0, 0.6);
8+
}

docs/src/pages/404.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 404 Not Found
2+
3+
{props.path} was not found.
4+
5+
export { default } from "../components/Layout.jsx";

docs/src/pages/@wq/index.mdx

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: npm Packages
3+
icon: npm-package
4+
section: Packages
5+
---
6+
7+
# npm Packages
8+
9+
<PackagesTable />
10+
11+
import {
12+
Table,
13+
TableBody,
14+
TableCell,
15+
TableContainer,
16+
TableHead,
17+
TableRow,
18+
Link,
19+
} from "@wq/material";
20+
import { usePages } from "@wq/gatsby-components";
21+
22+
export function PackagesTable() {
23+
const folder = usePages()
24+
.find((s) => s.name == "Packages")
25+
?.pages.find((s) => s.title == "npm Packages");
26+
const pages = folder
27+
? folder.pages.filter((page) => page.url !== folder.url)
28+
: [];
29+
return (
30+
<Table>
31+
<TableHead>
32+
<TableRow>
33+
<TableCell>Package</TableCell>
34+
<TableCell>Source</TableCell>
35+
<TableCell>NPM</TableCell>
36+
</TableRow>
37+
</TableHead>
38+
<TableBody>
39+
{pages.map((pkg) => (
40+
<TableRow key={pkg.title}>
41+
<TableCell>
42+
<Link to={pkg.url}>{pkg.title}</Link>
43+
</TableCell>
44+
<TableCell>
45+
<Link
46+
href={`https://github.com/wq/material/blob/main/packages/${pkg.url.replace(/^\/@wq\//, "")}`}
47+
>
48+
GitHub
49+
</Link>
50+
</TableCell>
51+
<TableCell>
52+
<Link
53+
href={`https://www.npmjs.com/package${pkg.url}`}
54+
>
55+
NPM
56+
</Link>
57+
</TableCell>
58+
</TableRow>
59+
))}
60+
</TableBody>
61+
</Table>
62+
);
63+
}
64+
65+
export { default, Head } from "../../components/Layout.jsx";
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
section: Packages
3+
icon: npm-package
4+
---
5+
6+
# @wq/material-native
7+
8+
WIP
9+
10+
export { default, Head } from "../../components/Layout.jsx";
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
section: Packages
3+
icon: npm-package
4+
---
5+
6+
# @wq/material-web
7+
8+
WIP
9+
10+
export { default, Head } from "../../components/Layout.jsx";

0 commit comments

Comments
 (0)