Files
blogflare/src/routes/+page.svelte
T
seahi a261803204
生产环境部署 - BlogFlare 至 Cloudflare Pages / 构建与自动化上线 (push) Failing after 5m9s
refactor: 统一使用路由参数对象格式化 URL 生成逻辑
2026-08-07 13:29:14 +08:00

41 lines
1.0 KiB
Svelte

<script lang="ts">
import { resolve } from '$app/paths';
import type { PageData } from './$types';
import { page } from '$app/stores';
let { data }: { data: PageData } = $props();
</script>
<svelte:head>
<title
>{$page.data.site?.title || 'BlogFlare'} - {$page.data.site?.description ||
'A Pure Cloudflare Blog'}</title
>
</svelte:head>
<section id="index-list">
<div class="post-list">
{#each data.posts as post (post.id || post)}
<a href={resolve('/posts/[slug]', { slug: post.slug })} class="card-link">
<article class="card article-content" class:has-cover={!!post.cover}>
{#if post.cover}
<div class="post-cover">
<img src={post.cover} alt={post.title} loading="lazy" />
</div>
{/if}
<div class="content-wrap">
<div class="post-meta-index">
<time>{post.date}</time>
</div>
<h1 class="title">{post.title}</h1>
<p class="excerpt">{post.excerpt}</p>
</div>
</article>
</a>
{/each}
</div>
</section>
<style>
/* Styles are now handled globally in app.css */
</style>