Skip to content

Commit 0f37168

Browse files
committed
docs: update slug and add content
1 parent f6e181d commit 0f37168

File tree

16 files changed

+77
-38
lines changed

16 files changed

+77
-38
lines changed

docs/construct-pages/base.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const createBaseScreen = async (createPage, graphql, reporter, screenName) => {
4242
menuLinks[`${screenName}ScreenMenuLinks`].forEach(
4343
(page, index) => (pageOrderMap[page] = index),
4444
);
45-
pages.forEach(page => {
45+
pages.forEach((page) => {
4646
if (pageOrderMap[page.node.parent.fileName] !== false) {
4747
finalPageEdges[pageOrderMap[page.node.parent.fileName]] = page;
4848
}
@@ -64,7 +64,7 @@ const createBaseScreen = async (createPage, graphql, reporter, screenName) => {
6464
context.jumpSection = context.next;
6565
}
6666
createPage({
67-
path: node.frontmatter.path,
67+
path: "/docs" + node.frontmatter.path,
6868
component: path.resolve(`./src/components/docs-layout.js`),
6969
context,
7070
});

docs/gatsby-config.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ if (!process.env.GH_TOKEN) {
22
require("dotenv").config();
33
}
44
const version = require("./package.json").version;
5+
const tailwindConfig = require("./tailwind.config.js");
56

67
module.exports = {
78
siteMetadata: {
@@ -60,7 +61,18 @@ module.exports = {
6061
},
6162
`gatsby-plugin-offline`,
6263
"gatsby-plugin-sass",
63-
`gatsby-plugin-postcss`,
64+
{
65+
resolve: `gatsby-plugin-postcss`,
66+
options: {
67+
postCssPlugins: [
68+
require(`tailwindcss`)(tailwindConfig),
69+
require(`autoprefixer`),
70+
...(process.env.NODE_ENV === `production`
71+
? [require(`cssnano`)]
72+
: []),
73+
],
74+
},
75+
},
6476
{
6577
resolve: "gatsby-plugin-prefetch-google-fonts",
6678
options: {

docs/gatsby-node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ exports.createPages = ({ graphql, actions, reporter }) => {
44
const { createPage, createRedirect } = actions;
55

66
createRedirect({
7-
fromPath: `/core/even-more`,
7+
fromPath: `/docs/core/even-more`,
88
isPermanent: true,
99
redirectInBrowser: true,
10-
toPath: `/dev/performance`,
10+
toPath: `/docs/dev/performance`,
1111
});
1212

1313
let screenOne = screen.createBaseScreen(

docs/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
"devDependencies": {
4444
"dotenv": "^8.2.0",
4545
"prettier": "2.0.5",
46-
"tailwindcss": "^1.4.4"
46+
"tailwindcss": "^1.4.6",
47+
"autoprefixer": "9.8.0",
48+
"cssnano": "4.1.10"
4749
},
4850
"keywords": [
4951
"lesy",
@@ -55,8 +57,7 @@
5557
"develop": "gatsby develop -H 0.0.0.0",
5658
"format": "prettier --write \"**/*.{js,jsx,json,md}\"",
5759
"start": "npm run develop",
58-
"serve": "gatsby serve",
59-
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
60+
"serve": "gatsby serve"
6061
},
6162
"repository": {
6263
"type": "git",

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
const visit = require("unist-util-visit");
22
module.exports = () => (tree, file) => {
3-
visit(tree, "text", node => {
4-
console.log("node=====......======>", node, "\n");
5-
3+
visit(tree, "text", (node) => {
64
if (textNode.value.includes(":icon-")) {
75
let value = child.value.replace(
86
/:icon-([a-z-]+)\s*/gim,
97
"<i class='$1'></i>",
108
);
11-
// console.log("node", textNode, "\n");
129
textNode.value = value;
1310
textNode.type = `html`;
1411
}

docs/src/components/layout.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
/**
2-
* Layout component that queries for data
3-
* with Gatsby's useStaticQuery component
4-
*
5-
* See: https://www.gatsbyjs.org/docs/use-static-query/
6-
*/
7-
81
import React, { useState, useEffect } from "react";
92
import PropTypes from "prop-types";
103
import Sidebar from "./sidebar";
@@ -18,8 +11,6 @@ const Layout = ({ children, content, allContent }) => {
1811
document.body.classList[method]("overflow-hidden");
1912
}, [isHidden]);
2013

21-
console.log({ content, allContent });
22-
2314
if (!content) return <></>;
2415

2516
return (
@@ -75,7 +66,7 @@ const Layout = ({ children, content, allContent }) => {
7566
content.toc.items.map((c) => {
7667
return (
7768
<Link
78-
to={content.frontmatter.path + c.url}
69+
to={"/docs" + content.frontmatter.path + c.url}
7970
className="text-gray-600 text-sm block leading-7"
8071
>
8172
{c.title}

docs/src/components/sidebar.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import Brand from "./visuals/brand";
77
const MenuLinks = ({ allContent }) => {
88
return (
99
<ul className="level-1">
10-
{allContent.map(c => {
10+
{allContent.map((c) => {
1111
return (
1212
<li>
1313
<Link
14-
to={c.node.frontmatter.path}
14+
to={`/docs${c.node.frontmatter.path}`}
1515
activeClassName="active"
1616
partiallyActive={true}
1717
>
@@ -29,15 +29,15 @@ const MenuLinks = ({ allContent }) => {
2929
const Sidebar = ({ allContent }) => {
3030
let isMainscreen = false;
3131

32-
let pagesObj = groupBy(allContent, item => {
32+
let pagesObj = groupBy(allContent, (item) => {
3333
return item.node.fields.section;
3434
});
3535

3636
if (allContent[0] && allContent[0].node.fields.screen == "main") {
3737
isMainscreen = true;
3838
}
3939

40-
let pages = Object.keys(pagesObj).map(k => ({
40+
let pages = Object.keys(pagesObj).map((k) => ({
4141
section: k,
4242
pages: pagesObj[k],
4343
}));
@@ -50,13 +50,13 @@ const Sidebar = ({ allContent }) => {
5050
<Brand />
5151
</div>
5252
{!isMainscreen && (
53-
<Link className="sidebar--backbtn" to="/get-started/overview">
53+
<Link className="sidebar--backbtn" to="/docs/get-started/overview">
5454
<i class="ri-arrow-left-line"></i> Back to main menu
5555
</Link>
5656
)}
5757
<div className="sidebar--menu mt-3">
5858
<ul className="level-0">
59-
{pages.map(page => {
59+
{pages.map((page) => {
6060
return (
6161
<li>
6262
<div className="heading">{page.section}</div>

docs/src/components/visuals/brand.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@ const Brand = ({ onSidebarToggle = () => {} }) => {
3030
</a>
3131
<div className="flex">
3232
<span
33-
className="text-xl mr-3 text-gray-500 hover:text-primary lg:hidden"
33+
className="text-2xl mr-3 text-gray-500 hover:text-primary lg:hidden"
3434
onClick={onSidebarToggle}
3535
>
3636
<i class="ri-menu-4-fill"></i>
3737
</span>
3838
<Link
3939
to="/"
4040
title="Home"
41-
className="text-xl mr-3 text-gray-500 hover:text-primary"
41+
className="text-2xl mr-3 text-gray-500 hover:text-primary"
4242
>
4343
<i class="ri-home-4-line"></i>
4444
</Link>
4545
<a
4646
href="https://github.com"
4747
title="Github repo"
48-
className="text-xl text-gray-500 hover:text-primary"
48+
className="text-2xl text-gray-500 hover:text-primary"
4949
>
5050
<i class="ri-github-line"></i>
5151
</a>

docs/src/components/visuals/chart.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import React from "react";
22
import { ResponsiveBar } from "@nivo/bar";
33

44
const Chart = ({ data }) => {
5-
// console.log("data2", data.results);
6-
75
return (
86
<div style={{ height: 400 }}>
97
<ResponsiveBar

docs/src/docs/screen:main/get-started/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Actually manual set up is also easy.
6969
npm init my-cli --yes
7070
```
7171

72-
**Step 2**: Get inside to your project directory and install `@lesy/compiler` with `npm` or `yarn`.
72+
**Step 2**: Get inside to your project directory and install `@lesy/compiler` with `npm` or `yarn`
7373

7474
```shell
7575
cd my-cli

0 commit comments

Comments
 (0)