Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/site-kit/src/lib/nav/MobileMenu.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import { afterNavigate } from '$app/navigation';
import { page } from '$app/state';
import { trap } from '../actions';
import { reduced_motion } from '../stores';
import { tick } from 'svelte';
Expand Down Expand Up @@ -147,7 +148,15 @@
<ul>
<li><a href="/chat">Discord</a></li>
<li><a href="https://bsky.app/profile/svelte.dev">Bluesky</a></li>
<li><a href="https://github.com/sveltejs/svelte">GitHub</a></li>
<li>
<a
href="https://github.com/sveltejs/{page.url.pathname.startsWith('/docs/kit')
? 'kit'
: page.url.pathname.startsWith('/docs/cli')
? 'cli'
: 'svelte'}">GitHub</a
>
</li>
</ul>
</div>
</div>
Expand Down
21 changes: 14 additions & 7 deletions packages/site-kit/src/lib/nav/Nav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Top navigation bar for the application. It provides a slot for the left side, th
import { overlay_open, on_this_page_open } from '../stores';
import { search } from '../state/search.svelte';
import Icon from '../components/Icon.svelte';
import { page } from '$app/stores';
import { page } from '$app/state';
import ThemeToggle from '../components/ThemeToggle.svelte';
import MobileMenu from './MobileMenu.svelte';
import type { NavigationLink } from '../types';
Expand Down Expand Up @@ -86,7 +86,7 @@ Top navigation bar for the application. It provides a slot for the left side, th
<Dropdown>
<a
href="/{link.slug}"
aria-current={$page.url.pathname.startsWith(`/${link.slug}`) ? 'page' : undefined}
aria-current={page.url.pathname.startsWith(`/${link.slug}`) ? 'page' : undefined}
>
{link.title}

Expand All @@ -99,8 +99,8 @@ Top navigation bar for the application. It provides a slot for the left side, th
<a
class="secondary"
href={section.path}
aria-current={$page.url.pathname === section.path ||
$page.url.pathname.startsWith(section.path!)
aria-current={page.url.pathname === section.path ||
page.url.pathname.startsWith(section.path!)
? 'page'
: undefined}
>
Expand All @@ -113,7 +113,7 @@ Top navigation bar for the application. It provides a slot for the left side, th
{:else}
<a
href="/{link.slug}"
aria-current={$page.url.pathname.startsWith(`/${link.slug}`) ? 'page' : null}
aria-current={page.url.pathname.startsWith(`/${link.slug}`) ? 'page' : null}
>
{link.title}
</a>
Expand All @@ -133,7 +133,14 @@ Top navigation bar for the application. It provides a slot for the left side, th
<span data-icon="bluesky"></span>
</a>

<a href="https://github.com/sveltejs/svelte" aria-label="GitHub Repo">
<a
href="https://github.com/sveltejs/{page.url.pathname.startsWith('/docs/kit')
? 'kit'
: page.url.pathname.startsWith('/docs/cli')
? 'cli'
: 'svelte'}"
aria-label="GitHub Repo"
>
<span data-icon="github"></span>
</a>
</div>
Expand Down Expand Up @@ -169,7 +176,7 @@ Top navigation bar for the application. It provides a slot for the left side, th
open = !open;

if (open) {
const segment = $page.url.pathname.split('/')[1];
const segment = page.url.pathname.split('/')[1];
current = links.find((link) => link.slug === segment);
}
}}
Expand Down