Skip to content

Commit 354423e

Browse files
committed
docs: refactor
1 parent 3390185 commit 354423e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+55
-137
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
run: npm run publish
6363

6464
- name: DOCS - build
65-
run: npm run publish
65+
run: npm run build-docs
6666

6767
- name: DOCS - publish
6868
uses: peaceiris/actions-gh-pages@v3

docs/construct-pages/base.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const menuLinks = require("../config/page-order");
22
const path = require("path");
33

4-
const createBaseScreen = async (createPage, graphql, reporter, screenName) => {
4+
const createDocPage = async (createPage, graphql, reporter, screenName) => {
55
const result = await graphql(`
66
query {
77
allMdx(filter: {fileAbsolutePath: {glob: "**/screen:${screenName}/**"}}) {
@@ -64,13 +64,13 @@ const createBaseScreen = async (createPage, graphql, reporter, screenName) => {
6464
context.jumpSection = context.next;
6565
}
6666
createPage({
67-
path: "/docs" + node.frontmatter.path,
68-
component: path.resolve(`./src/components/docs-layout.js`),
67+
path: node.frontmatter.path,
68+
component: path.resolve(`./src/templates/docs.js`),
6969
context,
7070
});
7171
});
7272
};
7373

7474
module.exports = {
75-
createBaseScreen,
75+
createDocPage,
7676
};

docs/gatsby-config.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,8 @@ module.exports = {
7878
options: {
7979
fonts: [
8080
{
81-
family: "IBM Plex Mono",
82-
variants: ["400", "500", "600", "700"],
83-
},
84-
{
85-
family: "Hind Siliguri",
86-
variants: ["300", "400", "500", "600", "700"],
81+
family: "Manrope",
82+
variants: ["700"],
8783
},
8884
],
8985
},

docs/gatsby-node.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,11 @@ exports.createPages = ({ graphql, actions, reporter }) => {
1010
toPath: `/docs/dev/performance`,
1111
});
1212

13-
let screenOne = screen.createBaseScreen(
14-
createPage,
15-
graphql,
16-
reporter,
17-
"main",
18-
);
19-
let screenTwo = screen.createBaseScreen(createPage, graphql, reporter, "dev");
20-
let screenThree = screen.createBaseScreen(
21-
createPage,
22-
graphql,
23-
reporter,
24-
"plugins",
25-
);
26-
return Promise.all([screenTwo, screenOne, screenThree]);
13+
const allDocs = [];
14+
["main", "dev", "plugins"].forEach((name) => {
15+
allDocs.push(screen.createDocPage(createPage, graphql, reporter, name));
16+
});
17+
return Promise.all(allDocs);
2718
};
2819

2920
exports.onCreateNode = ({ node, getNode, actions }) => {

docs/plugins/gatsby-remark-purple-headers/package.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/plugins/gatsby-remark-purple-headers/src/index.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/src/components/layout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const Layout = ({ children, content, allContent }) => {
6666
content.toc.items.map((c) => {
6767
return (
6868
<Link
69-
to={"/docs" + content.frontmatter.path + c.url}
69+
to={content.frontmatter.path + c.url}
7070
className="text-gray-600 text-sm block leading-7"
7171
>
7272
{c.title}

docs/src/components/sidebar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const MenuLinks = ({ allContent }) => {
1111
return (
1212
<li>
1313
<Link
14-
to={`/docs${c.node.frontmatter.path}`}
14+
to={`${c.node.frontmatter.path}`}
1515
activeClassName="active"
1616
partiallyActive={true}
1717
>

docs/src/docs/screen:dev/recipies/performance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Performance
3-
path: /dev/performance
3+
path: /docs/dev/performance
44
icon: terminal-box-fill
55
---
66

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
title: Sample2
3-
path: /dev/sample2
3+
path: /docs/dev/sample2
44
icon: terminal-box-fill
55
---

0 commit comments

Comments
 (0)