Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@fontsource/roboto": "^5.2.10",
"@fontsource/spectral": "^5.2.8",
"@lucide/svelte": "^1.7.0",
"@maiertech/sveltekit-helpers": "^0.48.3",
"@maiertech/sveltekit-helpers": "^0.49.0",
"@playwright/test": "^1.58.2",
"@stackblitz/sdk": "^1.11.0",
"@sveltejs/adapter-node": "^5.5.4",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="flex flex-wrap gap-6">
<div
// Not-sidebar (outer): videos & posts.
class="@container grow-999 min-inline-3/5"
class="@container grow-999 basis-0 min-inline-3/5"
>
<div class="mb-8 flex flex-wrap gap-6">
<h2 class="sr-only">Videos</h2>
Expand Down
4 changes: 4 additions & 0 deletions src/routes/notes/+layout.server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ORIGIN } from '$env/static/private';
import { sorted as notes } from '$lib/server/collections/notes.js';
import { latest as latestVideos } from '$lib/server/collections/videos.js';
import { error } from '@sveltejs/kit';
import type { LayoutServerLoad } from './$types';

Expand All @@ -12,9 +13,12 @@ export const load: LayoutServerLoad = async ({ url }) => {
error(404, 'Note not found.');
}

const recommendedVideos = latestVideos.slice(0, 3);

return {
origin: ORIGIN,
note,
recommendedVideos,
seo: {
title: note.title,
description: note.description,
Expand Down
27 changes: 23 additions & 4 deletions src/routes/notes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
<script lang="ts">
import { Note, SeoCanonicalUrl } from '@maiertech/sveltekit-helpers';
import { NoteHeader, SeoCanonicalUrl, VideoPreview } from '@maiertech/sveltekit-helpers';
import type { LayoutProps } from './$types';
import { Clock } from '@lucide/svelte';

let { data, children }: LayoutProps = $props();
</script>

<SeoCanonicalUrl origin={data.origin} />

<Note value={data.note}>
{@render children()}
</Note>
<div class="flex flex-wrap gap-10">
<div
// `basis-0` to prevent `basis-auto`, which resolves to intrinsic width of longest para.
class="grow-999 basis-0 min-inline-3/5"
>
<NoteHeader value={data.note} class="mb-8" />
{@render children()}

<p aria-hidden="true" class="mt-8 text-center text-ink-muted">✦</p>
</div>

<aside class="flex grow basis-2xs flex-col gap-3">
<h2 class="flex items-center gap-1 text-ink-muted">
<Clock class="size-5" />
<span class="text-lg font-semibold">My latest videos</span>
</h2>
{#each data.recommendedVideos as video (video.id)}
<VideoPreview value={video} class="mb-4" showDescription={false} />
{/each}
</aside>
</div>
Loading