Skip to content

Commit b9a8147

Browse files
committed
Bring back the default homepage
1 parent d78c135 commit b9a8147

File tree

10 files changed

+538
-54
lines changed

10 files changed

+538
-54
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Website
22

3-
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
3+
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
44

55
### Installation
66

docusaurus.config.js

Lines changed: 34 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
// @ts-check
2-
// Note: type annotations allow type checking and IDEs autocompletion
2+
// `@type` JSDoc annotations allow editor autocompletion and type checking
3+
// (when paired with `@ts-check`).
4+
// There are various equivalent ways to declare your Docusaurus config.
5+
// See: https://docusaurus.io/docs/api/docusaurus-config
36

4-
const {themes} = require('prism-react-renderer');
5-
const lightTheme = themes.github;
6-
const darkTheme = themes.dracula;
7-
8-
const organizationName = "devchat-ai";
9-
const projectName = "devchat-website";
7+
import {themes as prismThemes} from 'prism-react-renderer';
108

119
/** @type {import('@docusaurus/types').Config} */
1210
const config = {
13-
14-
organizationName,
15-
projectName,
16-
17-
title: 'Devchat',
11+
title: 'DevChat',
1812
favicon: 'img/favicon.ico',
1913

2014
// Set the production url of your site here
@@ -23,6 +17,11 @@ const config = {
2317
// For GitHub pages deployment, it is often '/<projectName>/'
2418
baseUrl: `/`,
2519

20+
// GitHub pages deployment config.
21+
// If you aren't using GitHub pages, you don't need these.
22+
organizationName: 'devchat-ai', // Usually your GitHub org/user name.
23+
projectName: 'devchat-website', // Usually your repo name.
24+
2625
onBrokenLinks: 'throw',
2726
onBrokenMarkdownLinks: 'warn',
2827

@@ -45,12 +44,11 @@ const config = {
4544

4645
presets: [
4746
[
48-
'@docusaurus/preset-classic',
47+
'classic',
4948
/** @type {import('@docusaurus/preset-classic').Options} */
5049
({
5150
docs: {
52-
routeBasePath: '/',
53-
sidebarPath: require.resolve('./sidebars.js'),
51+
sidebarPath: './sidebars.js',
5452
// Please change this to your repo.
5553
// Remove this to remove the "edit this page" links.
5654
editUrl:
@@ -73,73 +71,60 @@ const config = {
7371
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
7472
({
7573
navbar: {
76-
title: 'Devchat',
74+
title: 'DevChat',
7775
logo: {
78-
alt: 'Devchat Logo',
76+
alt: 'DevChat Logo',
7977
src: 'img/logo.svg',
8078
},
8179
items: [
82-
// {
83-
// type: 'docSidebar',
84-
// sidebarId: 'docSidebar',
85-
// position: 'left',
86-
// label: 'Document',
87-
// },
88-
// {to: '/blog', label: 'Blog', position: 'left'},
80+
{
81+
type: 'docSidebar',
82+
sidebarId: 'docSidebar',
83+
position: 'left',
84+
label: 'Document',
85+
},
86+
{
87+
href: 'https://github.com/devchat-ai',
88+
label: 'GitHub',
89+
position: 'right',
90+
},
8991
{
9092
type: 'localeDropdown',
9193
position: 'right',
9294
}
9395
],
9496
},
95-
/* footer: {
97+
footer: {
9698
style: 'dark',
9799
links: [
98-
{
99-
title: 'Docs',
100-
items: [
101-
{
102-
label: 'Tutorial',
103-
to: '/intro',
104-
},
105-
],
106-
},
107100
{
108101
title: 'Community',
109102
items: [
110-
{
111-
label: 'Stack Overflow',
112-
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
113-
},
114103
{
115104
label: 'Discord',
116-
href: 'https://discordapp.com/invite/docusaurus',
105+
href: 'https://discord.com/invite/9t3yrbBUXD',
117106
},
118107
{
119108
label: 'Twitter',
120-
href: 'https://twitter.com/docusaurus',
109+
href: 'https://twitter.com/DevChatAI',
121110
},
122111
],
123112
},
124113
{
125114
title: 'More',
126115
items: [
127-
{
128-
label: 'Blog',
129-
to: '/blog',
130-
},
131116
{
132117
label: 'GitHub',
133-
href: 'https://github.com/facebook/docusaurus',
118+
href: 'https://github.com/devchat-ai',
134119
},
135120
],
136121
},
137122
],
138-
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
139-
},*/
123+
copyright: `Copyright © ${new Date().getFullYear()} Merico, Inc.`,
124+
},
140125
prism: {
141-
theme: lightTheme,
142-
darkTheme: darkTheme,
126+
theme: prismThemes.github,
127+
darkTheme: prismThemes.dracula,
143128
},
144129
}),
145130
};
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"title": {
3-
"message": "Devchat",
3+
"message": "DevChat",
44
"description": "The title in the navbar"
55
},
66
"logo.alt": {
7-
"message": "Devchat Logo",
7+
"message": "DevChat Logo",
88
"description": "The alt text of navbar logo"
99
}
1010
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"title": {
3-
"message": "Devchat",
3+
"message": "DevChat",
44
"description": "The title in the navbar"
55
},
66
"logo.alt": {
7-
"message": "Devchat Logo",
7+
"message": "DevChat Logo",
88
"description": "The alt text of navbar logo"
99
}
1010
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import clsx from 'clsx';
2+
import Heading from '@theme/Heading';
3+
import styles from './styles.module.css';
4+
5+
const FeatureList = [
6+
{
7+
title: 'Easy to Use',
8+
Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default,
9+
description: (
10+
<>
11+
Docusaurus was designed from the ground up to be easily installed and
12+
used to get your website up and running quickly.
13+
</>
14+
),
15+
},
16+
{
17+
title: 'Focus on What Matters',
18+
Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default,
19+
description: (
20+
<>
21+
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
22+
ahead and move your docs into the <code>docs</code> directory.
23+
</>
24+
),
25+
},
26+
{
27+
title: 'Powered by React',
28+
Svg: require('@site/static/img/undraw_docusaurus_react.svg').default,
29+
description: (
30+
<>
31+
Extend or customize your website layout by reusing React. Docusaurus can
32+
be extended while reusing the same header and footer.
33+
</>
34+
),
35+
},
36+
];
37+
38+
function Feature({Svg, title, description}) {
39+
return (
40+
<div className={clsx('col col--4')}>
41+
<div className="text--center">
42+
<Svg className={styles.featureSvg} role="img" />
43+
</div>
44+
<div className="text--center padding-horiz--md">
45+
<Heading as="h3">{title}</Heading>
46+
<p>{description}</p>
47+
</div>
48+
</div>
49+
);
50+
}
51+
52+
export default function HomepageFeatures() {
53+
return (
54+
<section className={styles.features}>
55+
<div className="container">
56+
<div className="row">
57+
{FeatureList.map((props, idx) => (
58+
<Feature key={idx} {...props} />
59+
))}
60+
</div>
61+
</div>
62+
</section>
63+
);
64+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.features {
2+
display: flex;
3+
align-items: center;
4+
padding: 2rem 0;
5+
width: 100%;
6+
}
7+
8+
.featureSvg {
9+
height: 200px;
10+
width: 200px;
11+
}

src/pages/index.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import clsx from 'clsx';
2+
import Link from '@docusaurus/Link';
3+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
4+
import Layout from '@theme/Layout';
5+
import HomepageFeatures from '@site/src/components/HomepageFeatures';
6+
7+
import Heading from '@theme/Heading';
8+
import styles from './index.module.css';
9+
10+
function HomepageHeader() {
11+
const {siteConfig} = useDocusaurusContext();
12+
return (
13+
<header className={clsx('hero hero--primary', styles.heroBanner)}>
14+
<div className="container">
15+
<Heading as="h1" className="hero__title">
16+
{siteConfig.title}
17+
</Heading>
18+
<p className="hero__subtitle">{siteConfig.tagline}</p>
19+
<div className={styles.buttons}>
20+
<Link
21+
className="button button--secondary button--lg"
22+
to="/docs">
23+
Docusaurus Tutorial - 5min ⏱️
24+
</Link>
25+
</div>
26+
</div>
27+
</header>
28+
);
29+
}
30+
31+
export default function Home() {
32+
const {siteConfig} = useDocusaurusContext();
33+
return (
34+
<Layout
35+
title={`Hello from ${siteConfig.title}`}
36+
description="Description will go into a meta tag in <head />">
37+
<HomepageHeader />
38+
<main>
39+
<HomepageFeatures />
40+
</main>
41+
</Layout>
42+
);
43+
}

0 commit comments

Comments
 (0)