@@ -9,40 +9,39 @@ export const sharedPageComponents: SharedLayout = {
9
9
links : {
10
10
Synonym : "https://synonym.to" ,
11
11
GitHub : "https://github.com/pubky/pubky-knowledge-base" ,
12
- Discord : "https://discord.com/invite/DxTBJXvJxn " ,
12
+ Telegram : "https://t.me/pubkychat " ,
13
13
} ,
14
14
} ) ,
15
15
}
16
16
17
17
const explorer = Component . Explorer ( {
18
18
sortFn : ( a , b ) => {
19
19
// Helper function to prioritise "Introduction" and "ELI5"
20
- const priority = ( name : string ) => {
21
- if ( name === "Introduction" ) return - 2 ; // Highest priority
22
- if ( name === "ELI5" ) return - 1 ; // Second highest priority
23
- return 0 ; // No priority
24
- } ;
20
+ const priority = ( name : string ) => {
21
+ if ( name === "Introduction" ) return - 2 // Highest priority
22
+ if ( name === "ELI5" ) return - 1 // Second highest priority
23
+ return 0 // No priority
24
+ }
25
25
26
26
// Check if both are files or directories
27
- const aIsFile = typeof a . file !== null ;
28
- const bIsFile = typeof b . file !== null ;
27
+ const aIsFile = typeof a . file !== null
28
+ const bIsFile = typeof b . file !== null
29
29
30
30
// Prioritize specific filenames first
31
- const aPriority = priority ( a . name ) ;
32
- const bPriority = priority ( b . name ) ;
31
+ const aPriority = priority ( a . name )
32
+ const bPriority = priority ( b . name )
33
33
34
34
// If either has a priority, sort based on that
35
- if ( aPriority !== bPriority ) return aPriority - bPriority ;
35
+ if ( aPriority !== bPriority ) return aPriority - bPriority
36
36
37
37
// If one is a file and the other is a directory, sort files first
38
- if ( aIsFile && ! bIsFile ) return - 1 ; // a is a file, b is a directory
39
- if ( ! aIsFile && bIsFile ) return 1 ; // a is a directory, b is a file
38
+ if ( aIsFile && ! bIsFile ) return - 1 // a is a file, b is a directory
39
+ if ( ! aIsFile && bIsFile ) return 1 // a is a directory, b is a file
40
40
41
41
// If both are either files or directories, sort alphabetically
42
- return a . name . localeCompare ( b . name ) ;
43
- }
44
- } ) ;
45
-
42
+ return a . name . localeCompare ( b . name )
43
+ } ,
44
+ } )
46
45
47
46
// components for pages that display a single page (e.g. a single note)
48
47
export const defaultContentPageLayout : PageLayout = {
0 commit comments