Skip to content

Commit 398b1fc

Browse files
committed
setup docusaurus
1 parent 2350d96 commit 398b1fc

Some content is hidden

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

74 files changed

+2974
-37
lines changed

book/.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

book/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ yarn
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
Using SSH:
30+
31+
```
32+
$ USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```
38+
$ GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

book/babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

book/bun.lockb

444 KB
Binary file not shown.

book/docusaurus.config.ts

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
import type * as Preset from "@docusaurus/preset-classic";
2+
import type { Config } from "@docusaurus/types";
3+
import { themes as prismThemes } from "prism-react-renderer";
4+
5+
const config: Config = {
6+
title: "Meta Contract",
7+
tagline: "Meta Contract is a smart contract development framework.",
8+
favicon: "img/favicon.ico",
9+
10+
url: "https://mc-book.ecdysis.xyz",
11+
baseUrl: "/",
12+
13+
organizationName: "metacontract",
14+
projectName: "mc",
15+
16+
onBrokenLinks: "warn",
17+
onBrokenMarkdownLinks: "warn",
18+
19+
i18n: {
20+
defaultLocale: "en",
21+
locales: ["en"],
22+
},
23+
24+
presets: [
25+
[
26+
"classic",
27+
{
28+
docs: {
29+
path: "../docs",
30+
routeBasePath: "/",
31+
sidebarPath: require.resolve("./sidebars.ts"),
32+
editUrl: "https://github.com/metacontract/mc/tree/main/book",
33+
},
34+
theme: {
35+
customCss: "./src/css/custom.css",
36+
},
37+
} satisfies Preset.Options,
38+
],
39+
],
40+
41+
themeConfig: {
42+
image: "img/ecdysis-logo.png",
43+
navbar: {
44+
title: "Meta Contract",
45+
logo: {
46+
alt: "Ecdysis Logo",
47+
src: "img/ecdysis-logo.png",
48+
},
49+
items: [
50+
{
51+
to: "introduction",
52+
html: "Introduction",
53+
position: "left",
54+
},
55+
{
56+
to: "tutorials",
57+
html: "Tutorial",
58+
position: "left",
59+
},
60+
{
61+
to: "devops",
62+
html: "DevOps",
63+
position: "left",
64+
},
65+
{
66+
to: "plugin-functions",
67+
html: "Plugin Functions",
68+
position: "left",
69+
},
70+
{
71+
to: "resources",
72+
html: "Resources",
73+
position: "left",
74+
},
75+
{
76+
href: "https://github.com/metacontract/mc",
77+
label: "GitHub",
78+
position: "right",
79+
},
80+
],
81+
},
82+
footer: {
83+
style: "dark",
84+
links: [
85+
{
86+
title: "Docs",
87+
items: [
88+
{
89+
label: "Introduction",
90+
to: "/introduction",
91+
},
92+
{
93+
label: "Tutorial",
94+
to: "/tutorials",
95+
},
96+
{
97+
label: "DevOps",
98+
to: "/devops",
99+
},
100+
{
101+
label: "Plugin Functions",
102+
to: "/plugin-functions",
103+
},
104+
{
105+
label: "Resources",
106+
to: "/resources",
107+
},
108+
],
109+
},
110+
{
111+
title: "Community",
112+
items: [
113+
{
114+
label: "Stack Overflow",
115+
href: "https://stackoverflow.com/questions/tagged/metacontract",
116+
},
117+
{
118+
label: "X",
119+
href: "https://x.com/ecdysis_xyz",
120+
},
121+
],
122+
},
123+
{
124+
title: "More",
125+
items: [
126+
{
127+
label: "GitHub",
128+
href: "https://github.com/metacontract/mc",
129+
},
130+
],
131+
},
132+
],
133+
copyright: `Copyright © ${new Date().getFullYear()} Ecdysis, Inc. Built with Docusaurus.`,
134+
},
135+
prism: {
136+
theme: prismThemes.github,
137+
darkTheme: prismThemes.dracula,
138+
},
139+
} satisfies Preset.ThemeConfig,
140+
};
141+
142+
export default config;

book/package.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "mc-book",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"docusaurus": "docusaurus",
7+
"start": "docusaurus start",
8+
"build": "docusaurus build",
9+
"swizzle": "docusaurus swizzle",
10+
"deploy": "docusaurus deploy",
11+
"clear": "docusaurus clear",
12+
"serve": "docusaurus serve",
13+
"write-translations": "docusaurus write-translations",
14+
"write-heading-ids": "docusaurus write-heading-ids",
15+
"typecheck": "tsc"
16+
},
17+
"dependencies": {
18+
"@docusaurus/core": "3.5.2",
19+
"@docusaurus/preset-classic": "3.5.2",
20+
"@mdx-js/react": "^3.0.0",
21+
"clsx": "^2.0.0",
22+
"prism-react-renderer": "^2.3.0",
23+
"react": "^18.0.0",
24+
"react-dom": "^18.0.0"
25+
},
26+
"devDependencies": {
27+
"@docusaurus/module-type-aliases": "3.5.2",
28+
"@docusaurus/tsconfig": "3.5.2",
29+
"@docusaurus/types": "3.5.2",
30+
"typescript": "~5.5.2"
31+
},
32+
"browserslist": {
33+
"production": [">0.5%", "not dead", "not op_mini all"],
34+
"development": [
35+
"last 3 chrome version",
36+
"last 3 firefox version",
37+
"last 5 safari version"
38+
]
39+
},
40+
"engines": {
41+
"node": ">=18.0"
42+
}
43+
}

book/sidebars.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { SidebarsConfig } from "@docusaurus/plugin-content-docs";
2+
3+
const sidebars: SidebarsConfig = {
4+
sidebar: [{ type: "autogenerated", dirName: "." }],
5+
};
6+
7+
export default sidebars;

book/src/css/custom.css

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Any CSS included here will be global. The classic template
3+
* bundles Infima by default. Infima is a CSS framework designed to
4+
* work well for content-centric websites.
5+
*/
6+
7+
/* You can override the default Infima variables here. */
8+
:root {
9+
--ifm-color-primary: #2e8555;
10+
--ifm-color-primary-dark: #29784c;
11+
--ifm-color-primary-darker: #277148;
12+
--ifm-color-primary-darkest: #205d3b;
13+
--ifm-color-primary-light: #33925d;
14+
--ifm-color-primary-lighter: #359962;
15+
--ifm-color-primary-lightest: #3cad6e;
16+
--ifm-code-font-size: 95%;
17+
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
18+
}
19+
20+
/* For readability concerns, you should choose a lighter palette in dark mode. */
21+
[data-theme='dark'] {
22+
--ifm-color-primary: #25c2a0;
23+
--ifm-color-primary-dark: #21af90;
24+
--ifm-color-primary-darker: #1fa588;
25+
--ifm-color-primary-darkest: #1a8870;
26+
--ifm-color-primary-light: #29d5b0;
27+
--ifm-color-primary-lighter: #32d8b4;
28+
--ifm-color-primary-lightest: #4fddbf;
29+
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
30+
}

book/src/pages/index.module.css

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* CSS files with the .module.css suffix will be treated as CSS modules
3+
* and scoped locally.
4+
*/
5+
6+
.heroBanner {
7+
padding: 4rem 0;
8+
text-align: center;
9+
position: relative;
10+
overflow: hidden;
11+
}
12+
13+
@media screen and (max-width: 996px) {
14+
.heroBanner {
15+
padding: 2rem;
16+
}
17+
}
18+
19+
.buttons {
20+
display: flex;
21+
align-items: center;
22+
justify-content: center;
23+
}
24+
25+
.features {
26+
display: flex;
27+
align-items: center;
28+
padding: 2rem 0;
29+
width: 100%;
30+
}
31+
32+
.featureSvg {
33+
height: 200px;
34+
width: 200px;
35+
}

0 commit comments

Comments
 (0)