1- import { useState , useEffect } from 'react' ;
1+ import { useState , useEffect } from 'react' ;
22
33const useSearchableData = ( ) => {
44 const [ items , setItems ] = useState ( [ ] ) ;
@@ -59,12 +59,12 @@ const useSearchableData = () => {
5959 const allPosts = postsData . flatMap ( ( item ) =>
6060 item . series
6161 ? item . series . posts . map ( ( p ) => ( {
62- ...p ,
63- type : 'post' ,
64- title : `${ item . title } : ${ p . title } ` ,
65- path : `/blog/${ p . slug } ` ,
66- } ) )
67- : { ...item , type : 'post' , path : `/blog/${ item . slug } ` } ,
62+ ...p ,
63+ type : 'post' ,
64+ title : `${ item . title } : ${ p . title } ` ,
65+ path : `/blog/${ p . slug } ` ,
66+ } ) )
67+ : { ...item , type : 'post' , path : `/blog/${ item . slug } ` } ,
6868 ) ;
6969
7070 // Process Projects
@@ -83,37 +83,18 @@ const useSearchableData = () => {
8383
8484 // Define static routes and custom commands
8585 const staticRoutes = [
86- { title : 'Home' , slug : '/' , type : 'page' , path : '/' } ,
87- { title : 'Blog' , slug : '/blog' , type : 'page' , path : '/blog' } ,
88- {
89- title : 'Projects' ,
90- slug : '/projects' ,
91- type : 'page' ,
92- path : '/projects' ,
93- } ,
94- { title : 'About Me' , slug : '/about' , type : 'page' , path : '/about' } ,
95- { title : 'Logs' , slug : '/logs' , type : 'page' , path : '/logs' } ,
96- { title : 'News' , slug : '/news' , type : 'page' , path : '/news' } ,
97- {
98- title : 'Timeline' ,
99- slug : '/timeline' ,
100- type : 'page' ,
101- path : '/timeline' ,
102- } ,
103- {
104- title : 'Settings' ,
105- slug : '/settings' ,
106- type : 'page' ,
107- path : '/settings' ,
108- } ,
109- {
110- title : 'Stories' ,
111- slug : '/stories' ,
112- type : 'page' ,
113- path : '/stories' ,
114- } ,
115- { title : 'Apps' , slug : '/apps' , type : 'page' , path : '/apps' } ,
116- { title : 'Random' , slug : '/random' , type : 'page' , path : '/random' } ,
86+ { title : 'Home' , slug : '/' , type : 'page' , path : '/' } ,
87+ { title : 'Blog' , slug : '/blog' , type : 'page' , path : '/blog' } ,
88+ { title : 'Projects' , slug : '/projects' , type : 'page' , path : '/projects' , } ,
89+ { title : 'About Me' , slug : '/about' , type : 'page' , path : '/about' } ,
90+ { title : 'Logs' , slug : '/logs' , type : 'page' , path : '/logs' } ,
91+ { title : 'News' , slug : '/news' , type : 'page' , path : '/news' } ,
92+ { title : 'Fezzilla Roadmap' , slug : '/roadmap' , type : 'page' , path : '/roadmap' , } ,
93+ { title : 'Timeline' , slug : '/timeline' , type : 'page' , path : '/timeline' , } ,
94+ { title : 'Settings' , slug : '/settings' , type : 'page' , path : '/settings' , } ,
95+ { title : 'Stories' , slug : '/stories' , type : 'page' , path : '/stories' , } ,
96+ { title : 'Apps' , slug : '/apps' , type : 'page' , path : '/apps' } ,
97+ { title : 'Random' , slug : '/random' , type : 'page' , path : '/random' } ,
11798 ] ;
11899
119100 const customCommands = [
@@ -157,7 +138,7 @@ const useSearchableData = () => {
157138 type : 'command' ,
158139 commandId : 'openLinkedIn' ,
159140 } ,
160- { title : 'Scroll to Top' , type : 'command' , commandId : 'scrollToTop' } ,
141+ { title : 'Scroll to Top' , type : 'command' , commandId : 'scrollToTop' } ,
161142 {
162143 title : 'Scroll to Bottom' ,
163144 type : 'command' ,
@@ -168,7 +149,7 @@ const useSearchableData = () => {
168149 type : 'command' ,
169150 commandId : 'showSiteStats' ,
170151 } ,
171- { title : 'Show Version' , type : 'command' , commandId : 'showVersion' } ,
152+ { title : 'Show Version' , type : 'command' , commandId : 'showVersion' } ,
172153 {
173154 title : 'Go to Latest Post' ,
174155 type : 'command' ,
@@ -189,7 +170,7 @@ const useSearchableData = () => {
189170 type : 'command' ,
190171 commandId : 'digitalRain' ,
191172 } ,
192- { title : 'Generate Art' , type : 'command' , commandId : 'generateArt' } ,
173+ { title : 'Generate Art' , type : 'command' , commandId : 'generateArt' } ,
193174 {
194175 title : 'Leet Speak Transformer' ,
195176 type : 'command' ,
@@ -215,7 +196,7 @@ const useSearchableData = () => {
215196 type : 'command' ,
216197 commandId : 'clearLocalStorage' ,
217198 } ,
218- { title : 'Reload Page' , type : 'command' , commandId : 'reloadPage' } ,
199+ { title : 'Reload Page' , type : 'command' , commandId : 'reloadPage' } ,
219200 {
220201 title : 'Go to Random App' ,
221202 type : 'command' ,
@@ -231,7 +212,7 @@ const useSearchableData = () => {
231212 type : 'command' ,
232213 commandId : 'openGitHubIssue' ,
233214 } ,
234- { title : 'Her Daim' , type : 'command' , commandId : 'herDaim' } ,
215+ { title : 'Her Daim' , type : 'command' , commandId : 'herDaim' } ,
235216 {
236217 title : 'Do a Barrel Roll' ,
237218 type : 'command' ,
@@ -242,7 +223,7 @@ const useSearchableData = () => {
242223 type : 'command' ,
243224 commandId : 'toggleInvertColors' ,
244225 } ,
245- { title : 'Party Mode' , type : 'command' , commandId : 'partyMode' } ,
226+ { title : 'Party Mode' , type : 'command' , commandId : 'partyMode' } ,
246227 {
247228 title : 'Toggle Retro Mode' ,
248229 type : 'command' ,
@@ -313,7 +294,7 @@ const useSearchableData = () => {
313294 type : 'command' ,
314295 commandId : 'previousPage' ,
315296 } ,
316- { title : 'Next Page' , type : 'command' , commandId : 'nextPage' } ,
297+ { title : 'Next Page' , type : 'command' , commandId : 'nextPage' } ,
317298 ] ;
318299
319300 setItems ( [
@@ -334,7 +315,7 @@ const useSearchableData = () => {
334315 fetchData ( ) ;
335316 } , [ ] ) ;
336317
337- return { items, isLoading } ;
318+ return { items, isLoading} ;
338319} ;
339320
340321export default useSearchableData ;
0 commit comments