feat: dynamic home nav link
This commit is contained in:
parent
84652da1f9
commit
d8a42ec0a8
2 changed files with 8 additions and 5 deletions
|
@ -9,7 +9,14 @@ export interface Props {
|
|||
links: Array<Link>;
|
||||
}
|
||||
|
||||
const { links } = Astro.props;
|
||||
let { links } = Astro.props;
|
||||
|
||||
if (Astro.url.pathname !== "/") {
|
||||
links = [{
|
||||
url: "/",
|
||||
icon: "home",
|
||||
}].concat(links);
|
||||
}
|
||||
---
|
||||
|
||||
<nav>
|
||||
|
|
|
@ -10,10 +10,6 @@ export interface Props {
|
|||
|
||||
const { title, description } = Astro.props;
|
||||
const links: Link[] = [
|
||||
{
|
||||
url: "/",
|
||||
icon: "home",
|
||||
},
|
||||
{
|
||||
url: "https://ayos.blog",
|
||||
icon: "blog",
|
||||
|
|
Loading…
Reference in a new issue