---
import { getLanguageFromURL } from '../../languages';
import { SIDEBAR } from '../../config';
type Props = {
currentPage: string;
};
const { currentPage } = Astro.props as Props;
const langCode = getLanguageFromURL(currentPage);
const sidebar = SIDEBAR[langCode];
/*
* Github pages redirects to url with trailing slash which breaks link higlighting
* This utility does the trailing slash agnostic url paths comparement
*
* https://stackoverflow.com/questions/33270605/github-pages-trailing-slashes
*/
function isCurrentPageLink(link: string) {
return new RegExp(`/?${link}/?`).test(currentPage)
}
---