Skip to content

Commit 31244b7

Browse files
authored
Scaffold template (#17)
* Created base scaffold * Added Nextra scaffold
1 parent f7513c6 commit 31244b7

Some content is hidden

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

41 files changed

+31873
-0
lines changed
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*
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.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Intro
6+
7+
Let's discover **Docusaurus in less than 5 minutes**.
8+
9+
## Getting Started
10+
11+
Get started by **creating a new site**.
12+
13+
Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
14+
15+
### What you'll need
16+
17+
- [Node.js](https://nodejs.org/en/download/) version 18.0 or above:
18+
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
19+
20+
## Generate a new site
21+
22+
Generate a new Docusaurus site using the **classic template**.
23+
24+
The classic template will automatically be added to your project after you run the command:
25+
26+
```bash
27+
npm init docusaurus@latest my-website classic
28+
```
29+
30+
You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.
31+
32+
The command also installs all necessary dependencies you need to run Docusaurus.
33+
34+
## Start your site
35+
36+
Run the development server:
37+
38+
```bash
39+
cd my-website
40+
npm run start
41+
```
42+
43+
The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.
44+
45+
The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.
46+
47+
Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
import { themes as prismThemes } from "prism-react-renderer";
2+
import type { Config } from "@docusaurus/types";
3+
import type * as Preset from "@docusaurus/preset-classic";
4+
5+
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
6+
7+
const config: Config = {
8+
title: "Petstore Documentation Demo",
9+
tagline: "Dinosaurs are cool",
10+
favicon: "img/favicon.ico",
11+
12+
// Set the production url of your site here
13+
url: "https://your-docusaurus-site.example.com",
14+
// Set the /<baseUrl>/ pathname under which your site is served
15+
// For GitHub pages deployment, it is often '/<projectName>/'
16+
baseUrl: "/",
17+
18+
// GitHub pages deployment config.
19+
// If you aren't using GitHub pages, you don't need these.
20+
organizationName: "facebook", // Usually your GitHub org/user name.
21+
projectName: "docusaurus", // Usually your repo name.
22+
23+
onBrokenLinks: "throw",
24+
onBrokenMarkdownLinks: "warn",
25+
26+
// Even if you don't use internationalization, you can use this field to set
27+
// useful metadata like html lang. For example, if your site is Chinese, you
28+
// may want to replace "en" with "zh-Hans".
29+
i18n: {
30+
defaultLocale: "en",
31+
locales: ["en"],
32+
},
33+
34+
presets: [
35+
[
36+
"classic",
37+
{
38+
docs: {
39+
sidebarPath: "./sidebars.ts",
40+
// Please change this to your repo.
41+
// Remove this to remove the "edit this page" links.
42+
editUrl:
43+
"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/",
44+
},
45+
blog: {
46+
showReadingTime: true,
47+
feedOptions: {
48+
type: ["rss", "atom"],
49+
xslt: true,
50+
},
51+
// Please change this to your repo.
52+
// Remove this to remove the "edit this page" links.
53+
editUrl:
54+
"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/",
55+
// Useful options to enforce blogging best practices
56+
onInlineTags: "warn",
57+
onInlineAuthors: "warn",
58+
onUntruncatedBlogPosts: "warn",
59+
},
60+
theme: {
61+
customCss: "./src/css/custom.css",
62+
},
63+
} satisfies Preset.Options,
64+
],
65+
],
66+
67+
themeConfig: {
68+
// Replace with your project's social card
69+
image: "img/docusaurus-social-card.jpg",
70+
navbar: {
71+
title: "My Site",
72+
logo: {
73+
alt: "My Site Logo",
74+
src: "img/logo.svg",
75+
},
76+
items: [
77+
{
78+
type: "docSidebar",
79+
sidebarId: "tutorialSidebar",
80+
position: "left",
81+
label: "Docs",
82+
},
83+
{
84+
href: "https://github.com/facebook/docusaurus",
85+
label: "GitHub",
86+
position: "right",
87+
},
88+
],
89+
},
90+
footer: {
91+
style: "dark",
92+
links: [
93+
{
94+
title: "Docs",
95+
items: [
96+
{
97+
label: "Docs",
98+
to: "/docs/intro",
99+
},
100+
],
101+
},
102+
{
103+
title: "Community",
104+
items: [
105+
{
106+
label: "Stack Overflow",
107+
href: "https://stackoverflow.com/questions/tagged/docusaurus",
108+
},
109+
{
110+
label: "Discord",
111+
href: "https://discordapp.com/invite/docusaurus",
112+
},
113+
{
114+
label: "X",
115+
href: "https://x.com/docusaurus",
116+
},
117+
],
118+
},
119+
],
120+
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
121+
},
122+
prism: {
123+
theme: prismThemes.github,
124+
darkTheme: prismThemes.dracula,
125+
},
126+
} satisfies Preset.ThemeConfig,
127+
};
128+
129+
export default config;

0 commit comments

Comments
 (0)