File tree Expand file tree Collapse file tree
src/sections/Community/Handbook/handbook-single Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ import { IoIosArrowDropdownCircle } from "@react-icons/all-files/io/IoIosArrowDr
88const 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 ( / \. h t m l $ / , "" ) || 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 }
You can’t perform that action at this time.
0 commit comments