Add FAQ page and nav link
This commit is contained in:
+26
-12
@@ -4,6 +4,7 @@ const currentPath = Astro.url.pathname;
|
||||
const links = [
|
||||
{ href: "/", label: "home" },
|
||||
{ href: "/start", label: "start" },
|
||||
{ href: "/faq", label: "q&a" },
|
||||
{ href: "/about", label: "about" },
|
||||
{ href: "/projects", label: "projects" },
|
||||
{ href: "/now", label: "now" },
|
||||
@@ -19,18 +20,31 @@ function isActive(href: string, current: string): boolean {
|
||||
|
||||
<nav class="nav" aria-label="Main navigation">
|
||||
<div class="nav-inner">
|
||||
{links.map((link, i) => (
|
||||
<>
|
||||
{i > 0 && <span class="nav-sep" aria-hidden="true">·</span>}
|
||||
<a
|
||||
href={link.href}
|
||||
class:list={["nav-link", { active: isActive(link.href, currentPath) }]}
|
||||
aria-current={isActive(link.href, currentPath) ? "page" : undefined}
|
||||
>
|
||||
~/{link.label}
|
||||
</a>
|
||||
</>
|
||||
))}
|
||||
{
|
||||
links.map((link, i) => (
|
||||
<>
|
||||
{i > 0 && (
|
||||
<span class="nav-sep" aria-hidden="true">
|
||||
·
|
||||
</span>
|
||||
)}
|
||||
<a
|
||||
href={link.href}
|
||||
class:list={[
|
||||
"nav-link",
|
||||
{ active: isActive(link.href, currentPath) },
|
||||
]}
|
||||
aria-current={
|
||||
isActive(link.href, currentPath)
|
||||
? "page"
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
~/{link.label}
|
||||
</a>
|
||||
</>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user