Make blog generic template for anyone
This commit is contained in:
1 parent
29bd249a37
commit
342f889e57
116 files changed
+141
-5777
No files matched your search
@@ -1,12 +1,6 @@
|
||||
---
|
||||
export interface Props extends astroHTML.JSX.AnchorHTMLAttributes {}
|
||||
|
||||
const { href, class: className, ...props } = Astro.props as Props;
|
||||
const { href, class: className, ...props } = Astro.props;
|
||||
let isActive = href === Astro.url.pathname;
|
||||
|
||||
if (Astro.url.pathname.startsWith("/post/")) {
|
||||
isActive = true;
|
||||
}
|
||||
---
|
||||
|
||||
<a href={href} class:list={[className, { active: isActive }]} {...props}>
|
||||
|
||||
Reference in new issue
Block a user