Skip to content

Commit

Permalink
chore(front): updates heading hierarchies (#1163)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrebb committed Jan 17, 2024
1 parent c9101c1 commit 1ead3a4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion front/src/lib/components/posts/PostsGrid.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
style={lazyImage && `background-image: url('${lazyImage}');`}
>
<a href="/post/{slug}/" class="posts-grid-link">
<span class="link-bg">{title}</span>
<h2 class="link-bg">{title}</h2>
</a>
</li>
{/each}
Expand Down
3 changes: 2 additions & 1 deletion front/src/lib/layout/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
import '@styles/components/nav.css';
import '@styles/components/theme-toggle.css';
export let route;
export let navHeading;
export let navItems;
</script>

<header class="header" id="header">
<a href="#main" class="btn skip-to-content">Skip to Main Content</a>
<div class="site-title">
<NavHome {navHeading} />
<NavHome {navHeading} {route} />
</div>
{#if navItems}<NavBar {navItems} />{/if}
<ThemeToggle />
Expand Down
7 changes: 6 additions & 1 deletion front/src/lib/layout/NavHome.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<script>
export let route;
export let navHeading;
</script>

<a class="nav-home" href="/" aria-label="Dan Grebb | Home">
<h1>{navHeading}</h1>
{#if route === '/'}
<h1>{navHeading}</h1>
{:else}
{navHeading}
{/if}
</a>
2 changes: 1 addition & 1 deletion front/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</script>

<span class="flourish" />
<Header {navHeading} {navItems} />
<Header {navHeading} {navItems} {route} />
<main class="main" class:secondary class:l-post={post} data-sveltekit-noscroll>
<slot />
</main>
Expand Down
2 changes: 1 addition & 1 deletion front/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
</noscript>

<a id="main">Main Content</a>
<h1 class="headline">{headline}</h1>
<h2 class="headline">{headline}</h2>
{@html intro}
</section>

Expand Down

0 comments on commit 1ead3a4

Please sign in to comment.