feat(media): hidden 标签过滤与指南 public/media 约定(T5 补)
- 首页/归档/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
This commit is contained in:
1 parent
dcc20e9fb3
commit
71a799bd97
9 files changed
+82
-18
No files matched your search
@@ -8,7 +8,7 @@ import AiTranslatedBadge from '../../../components/AiTranslatedBadge.astro';
|
||||
import { t } from '../../../i18n/ui';
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const zh = (await getCollection('posts', ({ data }) => !data.draft)).sort(
|
||||
const zh = (await getCollection('posts', ({ data }) => !data.draft && !data.tags.includes('hidden'))).sort(
|
||||
(a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime(),
|
||||
);
|
||||
const en = new Map((await getCollection('postsEn')).map((e) => [e.id, e]));
|
||||
|
||||
@@ -9,7 +9,7 @@ import ProjectWall from '../../components/geek/ProjectWall.astro';
|
||||
import Heatmap from '../../components/geek/Heatmap.astro';
|
||||
import { t } from '../../i18n/ui';
|
||||
|
||||
const posts = (await getCollection('posts', ({ data }) => !data.draft)).sort(
|
||||
const posts = (await getCollection('posts', ({ data }) => !data.draft && !data.tags.includes('hidden'))).sort(
|
||||
(a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime(),
|
||||
);
|
||||
// 列表标题吃 postsEn 译题(缺译回退 zh,与 /en/archives 同策略)
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { APIContext } from 'astro';
|
||||
// 英文 RSS:postsEn 全量;标题缺译时回退 zh 标题(与 /en/ 页同策略)
|
||||
export async function GET(context: APIContext) {
|
||||
const en = new Map((await getCollection('postsEn')).map((e) => [e.id, e]));
|
||||
const posts = (await getCollection('posts', ({ data }) => !data.draft)).sort(
|
||||
const posts = (await getCollection('posts', ({ data }) => !data.draft && !data.tags.includes('hidden'))).sort(
|
||||
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(),
|
||||
);
|
||||
return rss({
|
||||
|
||||
Reference in new issue
Block a user