1- module . exports = {
1+ // @ts -check
2+ // Note: type annotations allow type checking and IDEs autocompletion
3+
4+ /** @type {import('@docusaurus/types').Config } */
5+ const config = {
26 title : 'react-native-rooster 🐔' ,
37 tagline : 'An elegant and flexible toast solution for your react-native apps' ,
48 url : 'https://mcodex.dev' ,
@@ -7,13 +11,46 @@ module.exports = {
711 favicon : 'img/favicon.ico' ,
812 organizationName : 'mcodex' ,
913 projectName : 'react-native-rooster' ,
14+
15+ // Performance and SEO optimization
16+ trailingSlash : true ,
17+ noIndex : false , // Allow search engine indexing
18+
19+ // Improved build settings
20+ staticDirectories : [ 'static' ] ,
21+
22+ // Webpack configuration for better performance
23+ webpack : {
24+ jsLoader : ( isServer ) => ( {
25+ loader : require . resolve ( 'swc-loader' ) ,
26+ options : {
27+ jsc : {
28+ parser : {
29+ syntax : 'ecmascript' ,
30+ jsx : true ,
31+ } ,
32+ transform : {
33+ react : {
34+ runtime : 'automatic' ,
35+ } ,
36+ } ,
37+ } ,
38+ } ,
39+ } ) ,
40+ } ,
41+
42+ /** @type {import('@docusaurus/preset-classic').ThemeConfig } */
1043 themeConfig : {
11- prism : {
12- theme : require ( 'prism-react-renderer/themes/dracula' ) ,
44+ // Replace dark mode by default
45+ colorMode : {
46+ defaultMode : 'light' ,
47+ respectPrefersColorScheme : true ,
1348 } ,
14- googleAnalytics : {
15- trackingID : 'UA-79205996-7' ,
49+ prism : {
50+ theme : require ( 'prism-react-renderer' ) . themes . dracula ,
1651 } ,
52+ // Google Analytics is now handled through gtag plugin
53+ // googleAnalytics has been removed in v3
1754 navbar : {
1855 title : 'react-native-rooster' ,
1956 logo : {
@@ -22,10 +59,10 @@ module.exports = {
2259 } ,
2360 items : [
2461 {
25- to : 'docs/' ,
26- activeBasePath : 'docs' ,
27- label : 'Docs' ,
62+ type : 'docSidebar' ,
63+ sidebarId : 'tutorialSidebar' ,
2864 position : 'right' ,
65+ label : 'Docs' ,
2966 } ,
3067 {
3168 href : 'https://github.com/mcodex/react-native-rooster' ,
@@ -43,13 +80,25 @@ module.exports = {
4380 style : 'dark' ,
4481 copyright : `Copyright © ${ new Date ( ) . getFullYear ( ) } Made with ❤️ by mCodex` ,
4582 } ,
83+ // Add image zoom
84+ zoom : {
85+ selector : '.markdown img' ,
86+ background : {
87+ light : 'rgb(255, 255, 255)' ,
88+ dark : 'rgb(50, 50, 50)'
89+ } ,
90+ config : {
91+ // options you can specify via https://github.com/francoischalifour/medium-zoom#usage
92+ } ,
93+ } ,
4694 } ,
4795 presets : [
4896 [
4997 '@docusaurus/preset-classic' ,
50- {
98+ /** @type {import('@docusaurus/preset-classic').Options } */
99+ ( {
51100 docs : {
52- homePageId : 'overview ' ,
101+ routeBasePath : 'docs ' ,
53102 sidebarPath : require . resolve ( './sidebars.js' ) ,
54103 editUrl :
55104 'https://github.com/mcodex/react-native-rooster/edit/website/website/' ,
@@ -63,7 +112,61 @@ module.exports = {
63112 theme : {
64113 customCss : require . resolve ( './src/css/custom.css' ) ,
65114 } ,
115+ googleAnalytics : {
116+ trackingID : 'UA-79205996-7' ,
117+ anonymizeIP : true ,
118+ } ,
119+ sitemap : {
120+ changefreq : 'weekly' ,
121+ priority : 0.5 ,
122+ } ,
123+ } ) ,
124+ ] ,
125+ ] ,
126+
127+ // Add plugins for better performance and SEO
128+ plugins : [
129+ [
130+ '@docusaurus/plugin-client-redirects' ,
131+ {
132+ fromExtensions : [ 'html' ] ,
133+ createRedirects : function ( existingPath ) {
134+ // Redirect old paths to new paths if any
135+ return undefined ;
136+ } ,
66137 } ,
67138 ] ,
139+ ( ) => ( {
140+ name : 'docusaurus-optimizations' ,
141+ injectHtmlTags ( ) {
142+ return {
143+ headTags : [
144+ {
145+ tagName : 'link' ,
146+ attributes : {
147+ rel : 'manifest' ,
148+ href : '/react-native-rooster/manifest.webmanifest' ,
149+ } ,
150+ } ,
151+ {
152+ tagName : 'meta' ,
153+ attributes : {
154+ name : 'theme-color' ,
155+ content : '#ff9100' ,
156+ } ,
157+ } ,
158+ {
159+ tagName : 'meta' ,
160+ attributes : {
161+ name : 'apple-mobile-web-app-capable' ,
162+ content : 'yes' ,
163+ } ,
164+ } ,
165+ ] ,
166+ } ;
167+ } ,
168+ } ) ,
68169 ] ,
69170} ;
171+
172+ module . exports = config ;
0 commit comments