-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathroutes.js
More file actions
74 lines (70 loc) · 1.99 KB
/
Copy pathroutes.js
File metadata and controls
74 lines (70 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/**
* Centralized route constants for the frontend.
* Mirrors the backend RouteConstants to ensure consistency across frontend and backend.
* Update these whenever routes are added, removed, or changed.
*/
export const ROUTES = {
HOME: '/home',
ABOUT: '/about',
GUIDELINES: '/guidelines',
ANNOUNCEMENTS: '/announcements',
TERMS_OF_SERVICE: '/termsofservice'
};
/**
* Array of non-content route paths.
* Use with Array.includes() to determine if a path is a static page vs. a content page.
*/
export const NON_CONTENT_ROUTES = [
ROUTES.HOME,
ROUTES.ABOUT,
ROUTES.GUIDELINES,
ROUTES.ANNOUNCEMENTS,
ROUTES.TERMS_OF_SERVICE
];
/**
* Navigation link definitions for the sidebar.
* Each link includes href, label, icon class, and active path matching patterns.
*/
export const NAVIGATION_LINKS = [
{
href: ROUTES.HOME,
label: 'Home',
iconClass: 'fas fa-home me-2',
activePaths: ['/', ROUTES.HOME],
key: 'home'
},
{
href: ROUTES.ABOUT,
label: 'About',
iconClass: 'fas fa-book me-2',
activePaths: [ROUTES.ABOUT],
key: 'about'
},
{
href: ROUTES.GUIDELINES,
label: 'Guidelines',
iconClass: 'fas fa-code me-2',
activePaths: [ROUTES.GUIDELINES],
key: 'guidelines'
},
{
href: ROUTES.ANNOUNCEMENTS,
label: 'Announcements',
iconClass: 'fas fa-bullhorn me-2',
activePaths: [ROUTES.ANNOUNCEMENTS],
key: 'announcements'
}
];
/**
* Determines if the given path is a content page (from sitemap)
* versus a static page (non-content).
* @param {string} path - The path to check
* @returns {boolean} - True if path is a content page, false if static page
*/
export function isContentPagePath(path) {
const normalizedPath = path.toLowerCase();
return !NON_CONTENT_ROUTES.some(route =>
normalizedPath === route.toLowerCase() ||
normalizedPath.startsWith(route.toLowerCase() + '/')
);
}