Skip to content

Commit bb19120

Browse files
committed
feat: convert to Docusaurus
1 parent 7f2507b commit bb19120

File tree

110 files changed

+20033
-1442
lines changed

Some content is hidden

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

110 files changed

+20033
-1442
lines changed

.gitignore

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
1-
node_modules/
2-
**/.DS_Store
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*

docs/0-setting-up/_category_.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"label": "Setting Up",
3+
"customProps": {
4+
"description": "Guides to set up your environment for TypeScript development."
5+
}
6+
}

docs/1-basics/_category_.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"label": "Basics",
3+
"customProps": {
4+
"description": "Learn the fundamentals of TypeScript, including type annotations, type assertions, and more."
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"label": "Intermediate Concepts",
3+
"customProps": {
4+
"description": "Explore intermediate TypeScript concepts like discriminated unions, intersection types, and more."
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"label": "Advanced Concepts",
3+
"customProps": {
4+
"description": "Dive into advanced TypeScript topics such as index types, mapped types, and advanced type manipulation."
5+
}
6+
}

docusaurus.config.ts

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
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: "My Site",
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+
organizationName: "jeffsieu",
19+
projectName: "typescript-from-zero",
20+
21+
onBrokenLinks: "throw",
22+
onBrokenMarkdownLinks: "warn",
23+
24+
// Even if you don't use internationalization, you can use this field to set
25+
// useful metadata like html lang. For example, if your site is Chinese, you
26+
// may want to replace "en" with "zh-Hans".
27+
i18n: {
28+
defaultLocale: "en",
29+
locales: ["en"],
30+
},
31+
32+
presets: [
33+
[
34+
"classic",
35+
{
36+
docs: {
37+
sidebarPath: "./sidebars.ts",
38+
// Please change this to your repo.
39+
// Remove this to remove the "edit this page" links.
40+
editUrl:
41+
"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/",
42+
},
43+
blog: false,
44+
theme: {
45+
customCss: "./src/css/custom.css",
46+
},
47+
} satisfies Preset.Options,
48+
],
49+
],
50+
51+
themeConfig: {
52+
image: "img/docusaurus-social-card.jpg",
53+
navbar: {
54+
title: "TypeScript from Zero",
55+
logo: {
56+
alt: "TypeScript from Zero",
57+
src: "img/logo.svg",
58+
},
59+
items: [
60+
{
61+
type: "docSidebar",
62+
sidebarId: "tutorialSidebar",
63+
position: "left",
64+
label: "Tutorial",
65+
},
66+
{
67+
href: "https://github.com/jeffsieu/typescript-from-zero",
68+
label: "GitHub",
69+
position: "right",
70+
},
71+
],
72+
},
73+
footer: {
74+
style: "dark",
75+
links: [
76+
{
77+
title: "Docs",
78+
items: [
79+
{
80+
label: "Tutorial",
81+
to: "/docs/intro",
82+
},
83+
],
84+
},
85+
{
86+
title: "Community",
87+
items: [
88+
{
89+
label: "Stack Overflow",
90+
href: "https://stackoverflow.com/questions/tagged/docusaurus",
91+
},
92+
{
93+
label: "Discord",
94+
href: "https://discordapp.com/invite/docusaurus",
95+
},
96+
{
97+
label: "X",
98+
href: "https://x.com/docusaurus",
99+
},
100+
],
101+
},
102+
{
103+
title: "More",
104+
items: [
105+
{
106+
label: "Blog",
107+
to: "/blog",
108+
},
109+
{
110+
label: "GitHub",
111+
href: "https://github.com/facebook/docusaurus",
112+
},
113+
],
114+
},
115+
],
116+
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
117+
},
118+
prism: {
119+
theme: prismThemes.github,
120+
darkTheme: prismThemes.dracula,
121+
},
122+
} satisfies Preset.ThemeConfig,
123+
};
124+
125+
export default config;

0 commit comments

Comments
 (0)