Skip to content

Commit 24e2878

Browse files
fix refresh by remove .html in url
Signed-off-by: Rajesh-Nagarajan-11 <rajeshnagarajan36@gmail.com>
1 parent ceee05d commit 24e2878

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/sections/Community/Handbook/handbook-single/HandbookTOC.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ import { IoIosArrowDropdownCircle } from "@react-icons/all-files/io/IoIosArrowDr
88
const HandbookTOC = ({ pages, currentSlug }) => {
99
const [expand, setExpand] = useState(false);
1010

11+
// Helper function to ensure clean URLs without .html extension
12+
const getCleanSlug = (slug) => {
13+
return slug?.replace(/\.html$/, "") || slug;
14+
};
15+
1116
return (
1217
<TOCWrapper>
1318
<div className="go-back">
@@ -38,7 +43,7 @@ const HandbookTOC = ({ pages, currentSlug }) => {
3843
{pages.map((page, index) => (
3944
<li key={index}>
4045
<Link
41-
to={page.fields.slug}
46+
to={getCleanSlug(page.fields.slug)}
4247
className={`toc-sub-heading toc-sub-inline${page.fields.slug === currentSlug ? " active" : ""}`}
4348
>
4449
{page.frontmatter.title}

0 commit comments

Comments
 (0)