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
4 changes: 2 additions & 2 deletions src/routes/notes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
<NoteHeader value={data.note} class="mb-8" />
{@render children()}

<p aria-hidden="true" class="mt-8 text-center text-ink-muted"></p>
<p aria-hidden="true" class="mt-8 text-center text-xl 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>
<span class="text-lg font-semibold">Latest videos</span>
</h2>
<VideoList values={data.recommendedVideos} level={3} />
</aside>
Expand Down
4 changes: 4 additions & 0 deletions src/routes/posts/+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 posts } from '$lib/server/collections/posts.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, 'Post not found.');
}

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

return {
origin: ORIGIN,
post,
recommendedVideos,
seo: {
title: post.title,
description: post.description,
Expand Down
22 changes: 20 additions & 2 deletions src/routes/posts/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script lang="ts">
import { VideoList } from '$lib/components';
import { Clock } from '@lucide/svelte';
import { PostHeader, SeoCanonicalUrl, SeoLdPost } from '@maiertech/sveltekit-helpers';
import type { LayoutProps } from './$types';

Expand All @@ -8,6 +10,22 @@
<SeoLdPost value={data.post} />
<SeoCanonicalUrl origin={data.origin} />

<PostHeader value={data.post} class="mb-12" />
<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"
>
<PostHeader value={data.post} class="mb-12" />
{@render children()}

{@render children()}
<p aria-hidden="true" class="mt-8 text-center text-xl 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">Latest videos</span>
</h2>
<VideoList values={data.recommendedVideos} level={3} />
</aside>
</div>
Loading