Sidebar links Example
2021-05-25
You can link any post to a sidebar button on data\staticPageRoutes.ts
.
export const staticPageRoutes = {
home: {
link: "/",
filepath: "/",
},
posts: {
link: "/#postList",
filepath: "/index",
},
aboutMe: {
link: "/tech/2021/05/25/SideBarLinksExample", // HERE !!!
filepath: "/[...postRoute]",
},
index: {
link: "/#postList",
filepath: "/index",
},
categories: {
link: "/categories",
filepath: "/categories",
},
projects: {
link: "/projects",
filepath: "/projects",
},
};
For example: current page route is /tech/2021/05/25/SideBarLinksExample
which assigned to staticPageRoutes.aboutMe
.
Then you can use it in sidebar or somewhere else.
hooks/useSiderBarData.ts
:
...
{
title: "About",
icon: "person",
desc: translate(locale.about),
...staticPageRoutes.aboutMe,
},
...
About this article
- Post Title: Sidebar links Example
- Create Date: 2021-05-25
- Category: Tech
- Tags: ProjectTitan
Messager
Put your comment box here