feat: dynamic home nav link

This commit is contained in:
Ayo 2023-05-29 11:03:15 +02:00
parent 84652da1f9
commit d8a42ec0a8
2 changed files with 8 additions and 5 deletions

View file

@ -9,7 +9,14 @@ export interface Props {
links: Array<Link>; links: Array<Link>;
} }
const { links } = Astro.props; let { links } = Astro.props;
if (Astro.url.pathname !== "/") {
links = [{
url: "/",
icon: "home",
}].concat(links);
}
--- ---
<nav> <nav>

View file

@ -10,10 +10,6 @@ export interface Props {
const { title, description } = Astro.props; const { title, description } = Astro.props;
const links: Link[] = [ const links: Link[] = [
{
url: "/",
icon: "home",
},
{ {
url: "https://ayos.blog", url: "https://ayos.blog",
icon: "blog", icon: "blog",