1- const { themes } = require ( "prism-react-renderer" ) ;
2-
3- // List of projects/orgs using your project for the users page.
4- const users = [
5- {
6- caption : "Docusaurus" ,
7- image : "https://docusaurus.io/img/docusaurus.svg" ,
8- infoLink : "https://docusaurus.io/" ,
9- pinned : true ,
10- } ,
11- ] ;
1+ import { themes } from "prism-react-renderer" ;
2+ import type { Config } from "@docusaurus/types" ;
3+ import type * as Preset from "@docusaurus/preset-classic" ;
124
135const setupDoc = "docs/basic/setup" ;
146
15- module . exports = {
7+ const config : Config = {
168 favicon : "img/icon.png" ,
179 title : "React TypeScript Cheatsheet" , // Title for your website.
18- tagline :
19- "A cheatsheet for experienced React developers getting started with TypeScript" ,
10+ tagline : "A cheatsheet for developers using React with TypeScript" ,
2011 url : "https://react-typescript-cheatsheet.netlify.app" , // Your website URL
2112 baseUrl : "/" ,
2213 projectName : "react-typescript-cheatsheet" ,
2314 organizationName : "typescript-cheatsheets" ,
2415
2516 presets : [
2617 [
27- "@docusaurus/preset- classic" ,
18+ "classic" ,
2819 {
2920 theme : {
3021 customCss : require . resolve ( "./src/css/custom.css" ) ,
@@ -37,8 +28,7 @@ module.exports = {
3728 editUrl :
3829 "https://github.com/typescript-cheatsheets/react/tree/main/docs" ,
3930 } ,
40- // ...
41- } ,
31+ } satisfies Preset . Options ,
4232 ] ,
4333 ] ,
4434
@@ -50,9 +40,6 @@ module.exports = {
5040 image :
5141 "https://user-images.githubusercontent.com/6764957/53868378-2b51fc80-3fb3-11e9-9cee-0277efe8a927.png" ,
5242
53- // Equivalent to `docsSideNavCollapsible`.
54- // sidebarCollapsible: false,
55-
5643 prism : {
5744 defaultLanguage : "typescript" ,
5845 theme : themes . github ,
@@ -68,20 +55,24 @@ module.exports = {
6855 items : [
6956 {
7057 to : setupDoc ,
71- label : "Docs" ,
58+ label : "Introduction" ,
59+ position : "right" ,
60+ } ,
61+ {
62+ to : "docs/basic/getting-started/basic_type_example" ,
63+ label : "Learn" ,
7264 position : "right" ,
7365 } ,
7466 {
75- to : "help " ,
76- label : "Help " ,
67+ to : "docs/reference/ComponentProps " ,
68+ label : "API Reference " ,
7769 position : "right" ,
7870 } ,
7971 {
8072 to : "https://discord.gg/wTGS5z9" ,
8173 label : "Discord" ,
8274 position : "right" ,
8375 } ,
84- // {to: 'blog', label: 'Blog', position: 'right'},
8576 ] ,
8677 } ,
8778
@@ -90,8 +81,6 @@ module.exports = {
9081 logo : {
9182 alt : "TypeScript Cheatsheets Logo" ,
9283 src : "img/icon.png" ,
93- // maxWidth: 128,
94- // style: { maxWidth: 128, maxHeight: 128 },
9584 } ,
9685 copyright : `Copyright © ${ new Date ( ) . getFullYear ( ) } TypeScript Cheatsheets` ,
9786 links : [
@@ -102,6 +91,14 @@ module.exports = {
10291 label : "Introduction" ,
10392 to : setupDoc ,
10493 } ,
94+ {
95+ label : "Learn" ,
96+ to : "docs/basic/getting-started/basic_type_example" ,
97+ } ,
98+ {
99+ label : "API Reference" ,
100+ to : "docs/reference/ComponentProps" ,
101+ } ,
105102 ] ,
106103 } ,
107104 {
@@ -111,14 +108,6 @@ module.exports = {
111108 label : "Stack Overflow" ,
112109 href : "https://stackoverflow.com/questions/tagged/typescript" ,
113110 } ,
114- {
115- label : "User Showcase" ,
116- to : "users" ,
117- } ,
118- {
119- label : "Help" ,
120- to : "help" ,
121- } ,
122111 {
123112 label : "Contributors" ,
124113 to : "contributors" ,
@@ -142,13 +131,11 @@ module.exports = {
142131 </a>` ,
143132 } ,
144133 {
145- // label: "Discord",
146134 html : `<a class="footer__link-item" href="https://discord.gg/wTGS5z9">
147135 <img src="https://img.shields.io/discord/508357248330760243.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2" style="max-width:100%;" alt="Discord">
148136 </a>` ,
149137 } ,
150138 {
151- // label: "Spread the word",
152139 html : `<a class="footer__link-item" href="http://twitter.com/home?status=Awesome%20%40Reactjs%20%2B%20%40TypeScript%20cheatsheet%20by%20%40ferdaber%2C%20%40sebsilbermann%2C%20%40swyx%20%26%20others!%20https%3A%2F%2Fgithub.com%2Ftypescript-cheatsheets%2Freact">
153140 <img src="https://img.shields.io/twitter/url?label=Help%20spread%20the%20word%21&style=social&url=https%3A%2F%2Fgithub.com%2Ftypescript-cheatsheets%2Freact" style="max-width:100%;" alt="X">
154141 </a>` ,
@@ -162,18 +149,12 @@ module.exports = {
162149 apiKey : "9a22585d1841d2fa758da919cd08a764" ,
163150 indexName : "react-typescript-cheatsheet" ,
164151 appId : "J65EL4UPXZ" ,
165- algoliaOptions : {
166- //... },
167- } ,
168152 } ,
169- } ,
153+ } satisfies Preset . ThemeConfig ,
170154
171155 customFields : {
172156 firstDoc : setupDoc ,
173-
174- // TODO useless user showcase page ?
175- users,
176- addUserUrl :
177- "https://github.com/typescript-cheatsheets/react/blob/main/website/docusaurus.config.js" ,
178157 } ,
179158} ;
159+
160+ export default config ;
0 commit comments