feat: Blog catalog and tags #7

Merged
aniva merged 11 commits from post/page into main 2024-10-10 14:49:18 -07:00
3 changed files with 36 additions and 5 deletions
Showing only changes of commit e823d76cbc - Show all commits

View File

@ -3,6 +3,9 @@
import { page } from '$app/stores';
import Footer from "./Footer.svelte";
import Navbar from "./Navbar.svelte";
import PageTransition from "./PageTransition.svelte";
export let data : { url: string };
</script>
<!-- Homepage has its own navbar with animations -->
@ -12,13 +15,18 @@
<Navbar />
<slot name="header" />
</div>
<div id="content">
<slot />
<main>
<PageTransition url={data.url}>
<slot />
</PageTransition>
<Footer />
</div>
</main>
</div>
{:else}
<slot />
<!-- On the home page -->
<PageTransition url={data.url}>
<slot />
</PageTransition>
<Footer />
{/if}
@ -97,7 +105,7 @@
gap: 20px;
}
}
#content {
main {
width: min(100vw, max(50vw, 100vh));
grid-area: content;
}

View File

@ -2,3 +2,9 @@ export const prerender = true;
// Prevent page 404 on refresh
export const trailingSlash = 'always';
export async function load({ url }) {
return {
url: url.pathname
}
}

View File

@ -0,0 +1,17 @@
<script lang="ts">
import { fade } from 'svelte/transition'
export let url: string
</script>
{#key url}
<div class="transition" in:fade>
<slot />
</div>
{/key}
<style>
.transition {
height: 100%;
}
</style>