diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-09-26 15:54:28 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-10-24 12:23:48 +0200 |
| commit | 70efcfeaa0603415dd992cb662d8efb960e6e49a (patch) | |
| tree | 5d37e98fae9aa7e5c3d8ef30a10db9fed9b63e36 /src/utils/constants.ts | |
| parent | 31695306bfed44409f03006ea717fd2cceff8f87 (diff) | |
refactor(routes): replace hardcoded routes with constants
It makes it easier to change a route if needed and it avoid typo
mistakes.
I also refactored a bit the concerned files to be complient with the
new ESlint config. However, I should rewrite the pages to reduce
the number of statements.
Diffstat (limited to 'src/utils/constants.ts')
| -rw-r--r-- | src/utils/constants.ts | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/utils/constants.ts b/src/utils/constants.ts new file mode 100644 index 0000000..e642af9 --- /dev/null +++ b/src/utils/constants.ts @@ -0,0 +1,32 @@ +export const PERSONAL_LINKS = { + GITHUB: 'https://github.com/ArmandPhilippot', + GITLAB: 'https://gitlab.com/ArmandPhilippot', + LINKEDIN: 'https://www.linkedin.com/in/armandphilippot', + SHAARLI: 'https://shaarli.armandphilippot.com/', +} as const; + +/** + * App routes. + * + * All static routes should be configured here to avoid 404 if a route changes. + */ +export const ROUTES = { + ARTICLE: '/article', + BLOG: '/blog', + CONTACT: '/contact', + CV: '/cv', + LEGAL_NOTICE: '/mentions-legales', + NOT_FOUND: '/404', + PROJECTS: '/projets', + RSS: '/feed', + SEARCH: '/recherche', + THEMATICS: { + INDEX: '/thematique', + FREE: '/thematique/libre', + LINUX: '/thematique/linux', + WEB_DEV: '/thematique/developpement-web', + }, + TOPICS: '/sujet', +} as const; + +// cSpell:ignore legales thematique developpement |
