Skip to content

Commit 780b03b

Browse files
committed
docs: update UI and add sidekick page
1 parent 8be7b36 commit 780b03b

File tree

27 files changed

+584
-97
lines changed

27 files changed

+584
-97
lines changed

docs/builders/create-doc-page.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ async function createDocPage(createPage, graphql, reporter, screenName) {
4545

4646
pages.forEach((page) => {
4747
if (pageOrderMap[page.node.parent.fileName] !== false) {
48-
console.log("**", pageOrderMap, page.node.parent.fileName);
4948
finalPageEdges[pageOrderMap[page.node.parent.fileName]] = page;
5049
}
5150
});

docs/builders/create-doc-pages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function createDocPages(pageTools) {
1212
});
1313

1414
const allDocs = [];
15-
["main", "dev", "plugins"].forEach((name) => {
15+
["main", "dev", "plugins", "developer"].forEach((name) => {
1616
allDocs.push(createDocPage(createPage, graphql, reporter, name));
1717
});
1818
return Promise.all(allDocs);

docs/config/doc-pages-config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ const devScreenMenuLinks = [
3131
"dev/recipies/sample2.md",
3232
];
3333

34+
const developerScreenMenuLinks = ["developer/architecture/internal.md"];
35+
3436
const pluginsScreenMenuLinks = [
3537
"plugins/docs/generator.md",
3638
"plugins/docs/configfiles.md",
@@ -39,11 +41,13 @@ const pluginsScreenMenuLinks = [
3941
"plugins/docs/pilot.md",
4042
"plugins/docs/prompt.md",
4143
"plugins/docs/validator.md",
44+
"plugins/docs/sidekick.md",
4245
];
4346

4447
module.exports = {
4548
mainScreenMenuLinks,
4649
devScreenMenuLinks,
50+
developerScreenMenuLinks,
4751
pageSectionNames,
4852
pluginsScreenMenuLinks,
4953
};

docs/gatsby-config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ const postcssOptions = {
6060
],
6161
};
6262

63+
const mailchimpOptions = {
64+
endpoint: process.env.MAILCHIMP_ENDPOINT,
65+
};
66+
6367
const githubAPIOptions = {
6468
token: process.env.GH_TOKEN,
6569
graphQLQuery: `
@@ -127,5 +131,9 @@ module.exports = {
127131
resolve: "gatsby-source-github-api",
128132
options: githubAPIOptions,
129133
},
134+
{
135+
resolve: "gatsby-plugin-mailchimp",
136+
options: mailchimpOptions,
137+
},
130138
],
131139
};

docs/gatsby-node.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
const { createDocNodes, createDocPages } = require("./builders");
22

3-
console.log({ createDocPages });
4-
53
exports.createPages = (pageTools) => {
64
createDocPages(pageTools);
75
};

docs/package-lock.json

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"gatsby": "^2.24.47",
1515
"gatsby-image": "^2.4.1",
1616
"gatsby-plugin-breadcrumb": "^9.0.2",
17+
"gatsby-plugin-mailchimp": "^5.2.2",
1718
"gatsby-plugin-manifest": "^2.4.2",
1819
"gatsby-plugin-mdx": "^1.2.6",
1920
"gatsby-plugin-offline": "^3.2.1",

docs/src/components/parts/features.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,51 @@ import Blade from "../visuals/blade";
44
const data = [
55
{
66
icon: "ri-file-list-3-line",
7+
title: "Commands",
78
themes: "bg-red-200 text-red-700",
89
desc:
9-
"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Vel magnam expedita ",
10+
"Flexible command formats and auto discovery. Limitless nested sub commands and dynamic command execution.",
1011
},
1112
{
1213
icon: "ri-terminal-window-line",
14+
title: "Typescript or JavaScript",
1315
themes: "bg-indigo-200 text-indigo-700",
1416
desc:
15-
"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Vel magnam expedita ",
17+
"Write in typescript with full types support without any additional setup.",
1618
},
1719
{
1820
icon: "ri-page-separator",
21+
title: "Plugins",
1922
themes: "bg-blue-200 text-blue-700",
2023
desc:
21-
"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Vel magnam expedita ",
24+
"Lesy is build with powerful plugin architecture. Add cool features to your app with plugins.",
2225
},
2326
{
2427
icon: "ri-question-line",
2528
themes: "bg-pink-200 text-pink-700",
29+
title: "Auto help",
2630
desc:
27-
"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Vel magnam expedita ",
31+
"Fully customizable beautiful automatic help generation with help plugin",
2832
},
2933
{
3034
icon: "ri-shopping-bag-3-line",
35+
title: "Middlewares",
3136
themes: "bg-teal-200 text-teal-700",
3237
desc:
33-
"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Vel magnam expedita ",
38+
"Sync and Async middlewares if you want to change the flow or behaviour of the app",
3439
},
3540
{
3641
icon: "ri-settings-3-line",
42+
title: "Configurable",
3743
themes: "bg-purple-200 text-purple-700",
3844
desc:
39-
"Lorem ipsum dolor sit amet consectetur, adipisicing elit. Vel magnam expedita ",
45+
"Whether it is a simple global/local config or from config file, its just easy",
4046
},
4147
];
4248

4349
const Features = () => {
4450
return (
45-
<div className="container mx-auto py-24 pb-10 lg:pb-24 mt-12">
46-
<div className="bg-secondary w-5/6 lg:w-2/6 rounded-lg text-white font-medium pl-10 pr-40 py-6 happy mb-20 mx-auto">
47-
Some cool features that you should try today!
48-
</div>
51+
<div className="container mx-auto py-10 pb-10 lg:pb-24 mt-12">
4952
<div className="flex flex-wrap">
5053
{data.map((d) => (
5154
<div className="lg:w-2/6 mb-12 px-6">

docs/src/components/parts/footer.js

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,39 @@ const data = [
44
{
55
title: "Code",
66
links: [
7-
{ name: "Github", link: "/" },
8-
{ name: "NPM", link: "/" },
7+
{ name: "Github", link: "https://github.com/lokesh-coder/lesyjs" },
8+
{ name: "Node package", link: "https://www.npmjs.com/package/lesy" },
99
],
1010
},
1111
{
1212
title: "Repository",
1313
links: [
14-
{ name: "Issues", link: "/" },
15-
{ name: "plugins", link: "/" },
14+
{ name: "Issues", link: "https://github.com/lokesh-coder/lesyjs/issues" },
15+
{
16+
name: "Plugins",
17+
link: "https://lesyjs.io/docs/library/official-plugins",
18+
},
1619
],
1720
},
1821
{
1922
title: "Project",
2023
links: [
21-
{ name: "Changelog", link: "/" },
22-
{ name: "License", link: "/" },
24+
{
25+
name: "Releases",
26+
link: "https://github.com/lokesh-coder/lesyjs/releases",
27+
},
28+
{
29+
name: "License",
30+
link:
31+
"https://github.com/lokesh-coder/lesyjs/blob/master/packages/cli/LICENCE",
32+
},
2333
],
2434
},
2535
{
2636
title: "Updates",
2737
links: [
28-
{ name: "Twitter", link: "/" },
29-
{ name: "Spectrum", link: "/" },
38+
{ name: "Twitter", link: "https://twitter.com/lesyjs" },
39+
{ name: "Spectrum", link: "https://spectrum.chat/lesyjs" },
3040
],
3141
},
3242
];
@@ -44,12 +54,15 @@ const Footer = () => {
4454
</div>
4555
<div className="w-full lg:w-6/12 flex">
4656
{data.map((d) => (
47-
<div className="w-4/12 lg:text-right">
48-
<h5 className="uppercase text-gray-600 text-sm font-medium">
57+
<div className="w-4/12">
58+
<h5 className="lowercase text-primary text-xl font-heading font-bold mb-3 ">
4959
{d.title}
5060
</h5>
5161
{d.links.map((l) => (
52-
<a href={l.link} className="text-gray-500 block">
62+
<a
63+
href={l.link}
64+
className="text-gray-500 block text-sm leading-6"
65+
>
5366
{l.name}
5467
</a>
5568
))}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import React, { useState } from "react";
2+
import addToMailchimp from "gatsby-plugin-mailchimp";
3+
4+
const NewsletterSection = () => {
5+
const [email, setEmail] = useState(null);
6+
const [status, setStatus] = useState({});
7+
const onChange = (e) => {
8+
e.target.setCustomValidity("");
9+
setEmail(e.target.value);
10+
};
11+
const onSubscribe = async (e) => {
12+
e.preventDefault();
13+
const result = await addToMailchimp(email);
14+
console.log("result", result);
15+
setStatus(result);
16+
};
17+
18+
return (
19+
<div className="container mx-auto px-5 py-24 pb-10 lg:pb-24 lg:flex">
20+
<div className="w-full lg:w-6/12">
21+
<h2 className="text-3xl text-left inline-block font-bold text-heading font-heading">
22+
Sign up for latest news and updates
23+
</h2>
24+
<p className="my-2">
25+
No spams and no nonsense mails. Just the sweet and hot news
26+
</p>
27+
</div>
28+
<form className="w-full lg:w-6/12 mt-2" onSubmit={onSubscribe}>
29+
<div className="flex items-center">
30+
<input
31+
type="email"
32+
placeholder="[email protected]"
33+
className="w-full px-4 py-4 mr-2 bg-gray-100 rounded-md border border-gray-400 focus:outline-none"
34+
onChange={onChange}
35+
required
36+
onInvalid={(e) =>
37+
e.target.setCustomValidity("Please enter valid email address")
38+
}
39+
/>
40+
<button className="bg-secondary text-white px-5 py-4 rounded shadow w-1/4 font-bold">
41+
Notify
42+
</button>
43+
</div>
44+
{status.result === "error" && (
45+
<div
46+
dangerouslySetInnerHTML={{ __html: status.msg }}
47+
className="text-xs mt-2 px-4"
48+
></div>
49+
)}
50+
{status.result === "success" && (
51+
<div className="text-xs mt-2 px-4">{status.msg}</div>
52+
)}
53+
</form>
54+
</div>
55+
);
56+
};
57+
58+
export default NewsletterSection;

0 commit comments

Comments
 (0)