blog/frontend/src/lib/post/framework/ui/PostOverallPage.svelte
SquidSpirit 95fabee99d
All checks were successful
Frontend CI / build (push) Successful in 1m7s
BLOG-73 Change website title dynamically (#77)
### Description

- Use `generateTitle` to combine app name and page title.

### Package Changes

_No response_

### Screenshots

|Home|Post Overall|Post Content|
|-|-|-|
|![Screenshot From 2025-07-26 01-58-04.png](/attachments/70ed7440-bd5a-4e9d-a747-bb785c9f7e16)|![Screenshot From 2025-07-26 01-58-27.png](/attachments/58386f0d-e476-4795-8ac4-f0abc6586721)|![Screenshot From 2025-07-26 01-58-31.png](/attachments/cf7cb5a6-af5e-4dc6-907f-8cb8253f1b13)|

### Reference

Resolves #73

### Checklist

- [x] A milestone is set
- [x] The related issuse has been linked to this branch

Reviewed-on: #77
Co-authored-by: SquidSpirit <squid@squidspirit.com>
Co-committed-by: SquidSpirit <squid@squidspirit.com>
2025-07-26 02:01:24 +08:00

24 lines
891 B
Svelte

<script lang="ts">
import generateTitle from '$lib/common/framework/ui/generateTitle';
import { PostListBloc, PostListEventType } from '$lib/post/adapter/presenter/postListBloc';
import PostPreview from '$lib/post/framework/ui/PostPreview.svelte';
import { getContext, onMount } from 'svelte';
const postListBloc = getContext<PostListBloc>(PostListBloc.name);
const state = $derived($postListBloc);
onMount(() => postListBloc.dispatch({ event: PostListEventType.PostListLoadedEvent }));
</script>
<svelte:head>
<title>{generateTitle('文章')}</title>
</svelte:head>
<div class="container pb-10">
<h1 class="py-9 text-center text-3xl font-bold text-gray-800 md:py-20 md:text-5xl">文章</h1>
<div class="grid grid-cols-1 gap-6 md:grid-cols-2 md:gap-y-8 lg:grid-cols-3">
{#each state.data ?? [] as postInfo (postInfo.id)}
<PostPreview {postInfo} />
{/each}
</div>
</div>