mirror of
https://github.com/LBRYFoundation/lbry-tech.git
synced 2025-03-04 06:57:53 +00:00
update
This commit is contained in:
parent
67dc9aea69
commit
559d2339c9
1 changed files with 10 additions and 2 deletions
|
@ -8,14 +8,22 @@ import TableOfContents from '../components/TableOfContents.astro';
|
||||||
import '../styles/markdown.css';
|
import '../styles/markdown.css';
|
||||||
|
|
||||||
const { frontmatter, headings, collection } = Astro.props;
|
const { frontmatter, headings, collection } = Astro.props;
|
||||||
const { pathname } = Astro.url;
|
let { pathname } = Astro.url;
|
||||||
|
if (pathname.split('')[pathname.length - 1] === '/') pathname = pathname.substring(0, pathname.length - 1);
|
||||||
|
|
||||||
const items = await getCollection(collection) || [];
|
const items = await getCollection(collection) || [];
|
||||||
|
|
||||||
const description = await markdown.parse(frontmatter.description);
|
const description = await markdown.parse(frontmatter.description);
|
||||||
|
|
||||||
const isActive = (href: string)=>{
|
const isActive = (href: string)=>{
|
||||||
if (href[href.length - 1] === '/') href.split('').pop().join('');
|
if (pathname.split('')[pathname.length - 1] === '/') {
|
||||||
|
pathname = pathname.split('');
|
||||||
|
pathname.pop();
|
||||||
|
pathname = pathname.join('');
|
||||||
|
}
|
||||||
|
console.log(pathname);
|
||||||
|
|
||||||
|
|
||||||
return href === pathname || href === pathname.split('/').slice(0,2).join('/');
|
return href === pathname || href === pathname.split('/').slice(0,2).join('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue