- 首页/归档/RSS(zh+en)集合查询统一 draft+hidden 双过滤——样张
永久保留为可访问不列出的活样例(回归测试资产)
- 写作指南视音频段更正:raw HTML 相对路径不走资产管线(实测),
媒体放 public/media/{slug}/ 用绝对 /media/ 引用,与仓外 store
同命名空间
验证: pnpm astro build exit 0(hidden 过滤后样张退出列表与 RSS)
Spec: 2026-10-25_add-media-and-polish
Co-authored-by: GLM-5.3
32 lines
955 B
Plaintext
32 lines
955 B
Plaintext
---
|
|
// 导航「文章」落点:全量归档列表(年份/轨道分节逻辑与首页共用 PostList)
|
|
import { getCollection } from 'astro:content';
|
|
import BaseLayout from '../../layouts/BaseLayout.astro';
|
|
import PostList from '../../components/PostList.astro';
|
|
|
|
const posts = (await getCollection('posts', ({ data }) => !data.draft && !data.tags.includes('hidden'))).sort(
|
|
(a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime(),
|
|
);
|
|
---
|
|
|
|
<BaseLayout title="文章 · wait4x">
|
|
<h1 class="page-title">文章</h1>
|
|
<p class="page-note">按年份归档 · 轨道分节 · 共 {posts.length} 篇</p>
|
|
<PostList {posts} />
|
|
</BaseLayout>
|
|
|
|
<style>
|
|
.page-title {
|
|
font-size: var(--text-h1);
|
|
line-height: var(--leading-heading);
|
|
color: var(--ink-1);
|
|
margin-top: var(--space-5);
|
|
text-wrap: balance;
|
|
}
|
|
.page-note {
|
|
font-size: 13px;
|
|
color: var(--ink-4);
|
|
margin-block: var(--space-1) var(--space-4);
|
|
}
|
|
</style>
|