1- import { useState , useEffect , useMemo } from 'react' ;
1+ import { useEffect , useMemo , useState } from 'react' ;
22import piml from 'piml' ;
33
44const useSearchableData = ( ) => {
@@ -102,12 +102,12 @@ const useSearchableData = () => {
102102 const allPosts = postsData . flatMap ( ( item ) =>
103103 item . series
104104 ? item . series . posts . map ( ( p ) => ( {
105- ...p ,
106- type : 'post' ,
107- title : `${ item . title } : ${ p . title } ` ,
108- path : `/blog/series/${ item . slug } /${ p . slug } ` ,
109- } ) )
110- : { ...item , type : 'post' , path : `/blog/${ item . slug } ` } ,
105+ ...p ,
106+ type : 'post' ,
107+ title : `${ item . title } : ${ p . title } ` ,
108+ path : `/blog/series/${ item . slug } /${ p . slug } ` ,
109+ } ) )
110+ : { ...item , type : 'post' , path : `/blog/${ item . slug } ` } ,
111111 ) ;
112112
113113 // Process Projects
@@ -126,42 +126,18 @@ const useSearchableData = () => {
126126
127127 // Define static routes and custom commands
128128 const staticRoutes = [
129- { title : 'Home' , slug : '/' , type : 'page' , path : '/' } ,
130- { title : 'Blog' , slug : '/blog' , type : 'page' , path : '/blog' } ,
131- {
132- title : 'Projects' ,
133- slug : '/projects' ,
134- type : 'page' ,
135- path : '/projects' ,
136- } ,
137- { title : 'About Me' , slug : '/about' , type : 'page' , path : '/about' } ,
138- { title : 'Logs' , slug : '/logs' , type : 'page' , path : '/logs' } ,
139- {
140- title : 'Fezzilla Roadmap' ,
141- slug : '/roadmap' ,
142- type : 'page' ,
143- path : '/roadmap' ,
144- } ,
145- {
146- title : 'Timeline' ,
147- slug : '/timeline' ,
148- type : 'page' ,
149- path : '/timeline' ,
150- } ,
151- {
152- title : 'Settings' ,
153- slug : '/settings' ,
154- type : 'page' ,
155- path : '/settings' ,
156- } ,
157- {
158- title : 'Stories' ,
159- slug : '/stories' ,
160- type : 'page' ,
161- path : '/stories' ,
162- } ,
163- { title : 'Apps' , slug : '/apps' , type : 'page' , path : '/apps' } ,
164- { title : 'Random' , slug : '/random' , type : 'page' , path : '/random' } ,
129+ { title : 'Home' , slug : '/' , type : 'page' , path : '/' } ,
130+ { title : 'Blog' , slug : '/blog' , type : 'page' , path : '/blog' } ,
131+ { title : 'Projects' , slug : '/projects' , type : 'page' , path : '/projects' } ,
132+ { title : 'About Me' , slug : '/about' , type : 'page' , path : '/about' } ,
133+ { title : 'Logs' , slug : '/logs' , type : 'page' , path : '/logs' } ,
134+ { title : 'Fezzilla Roadmap' , slug : '/roadmap' , type : 'page' , path : '/roadmap' } ,
135+ { title : 'Timeline' , slug : '/timeline' , type : 'page' , path : '/timeline' } ,
136+ { title : 'Settings' , slug : '/settings' , type : 'page' , path : '/settings' } ,
137+ { title : 'Stories' , slug : '/stories' , type : 'page' , path : '/stories' } ,
138+ { title : 'Glossary' , slug : '/vocab' , type : 'page' , path : '/vocab' } ,
139+ { title : 'Apps' , slug : '/apps' , type : 'page' , path : '/apps' } ,
140+ { title : 'Random' , slug : '/random' , type : 'page' , path : '/random' } ,
165141 ] ;
166142
167143 const customCommands = [
@@ -205,7 +181,7 @@ const useSearchableData = () => {
205181 type : 'command' ,
206182 commandId : 'openLinkedIn' ,
207183 } ,
208- { title : 'Scroll to Top' , type : 'command' , commandId : 'scrollToTop' } ,
184+ { title : 'Scroll to Top' , type : 'command' , commandId : 'scrollToTop' } ,
209185 {
210186 title : 'Scroll to Bottom' ,
211187 type : 'command' ,
@@ -216,7 +192,7 @@ const useSearchableData = () => {
216192 type : 'command' ,
217193 commandId : 'showSiteStats' ,
218194 } ,
219- { title : 'Show Version' , type : 'command' , commandId : 'showVersion' } ,
195+ { title : 'Show Version' , type : 'command' , commandId : 'showVersion' } ,
220196 {
221197 title : 'Go to Latest Post' ,
222198 type : 'command' ,
@@ -237,7 +213,7 @@ const useSearchableData = () => {
237213 type : 'command' ,
238214 commandId : 'digitalRain' ,
239215 } ,
240- { title : 'Generate Art' , type : 'command' , commandId : 'generateArt' } ,
216+ { title : 'Generate Art' , type : 'command' , commandId : 'generateArt' } ,
241217 {
242218 title : 'Leet Speak Transformer' ,
243219 type : 'command' ,
@@ -263,7 +239,7 @@ const useSearchableData = () => {
263239 type : 'command' ,
264240 commandId : 'clearLocalStorage' ,
265241 } ,
266- { title : 'Reload Page' , type : 'command' , commandId : 'reloadPage' } ,
242+ { title : 'Reload Page' , type : 'command' , commandId : 'reloadPage' } ,
267243 {
268244 title : 'Go to Random App' ,
269245 type : 'command' ,
@@ -279,7 +255,7 @@ const useSearchableData = () => {
279255 type : 'command' ,
280256 commandId : 'openGitHubIssue' ,
281257 } ,
282- { title : 'Her Daim' , type : 'command' , commandId : 'herDaim' } ,
258+ { title : 'Her Daim' , type : 'command' , commandId : 'herDaim' } ,
283259 {
284260 title : 'Do a Barrel Roll' ,
285261 type : 'command' ,
@@ -290,7 +266,7 @@ const useSearchableData = () => {
290266 type : 'command' ,
291267 commandId : 'toggleInvertColors' ,
292268 } ,
293- { title : 'Party Mode' , type : 'command' , commandId : 'partyMode' } ,
269+ { title : 'Party Mode' , type : 'command' , commandId : 'partyMode' } ,
294270 {
295271 title : 'Toggle Retro Mode' ,
296272 type : 'command' ,
@@ -386,7 +362,7 @@ const useSearchableData = () => {
386362 type : 'command' ,
387363 commandId : 'previousPage' ,
388364 } ,
389- { title : 'Next Page' , type : 'command' , commandId : 'nextPage' } ,
365+ { title : 'Next Page' , type : 'command' , commandId : 'nextPage' } ,
390366 ] ;
391367
392368 setItems ( [
@@ -407,7 +383,7 @@ const useSearchableData = () => {
407383 fetchData ( ) ;
408384 } , [ categories ] ) ;
409385
410- return { items, isLoading } ;
386+ return { items, isLoading} ;
411387} ;
412388
413389export default useSearchableData ;
0 commit comments