- 设计令牌:暖米 #F9F8F6 纸面 × 柔和黑 #1C1C1C,透明度分层 /60 /40 /10,纯单色 - 圆角归零、阴影清零、渐变清除;删除渐变光斑背景层 Background.astro - 字体:Playfair Display + Noto Serif SC 衬线标题(weight 400)+ Noto Sans SC 正文 - 首页巨型衬线刊名 + 日期线 + 最新发布索引卡;Section 自动编号 - 文章页改刊头式标题区;归档改衬线年号 + 目录行;卡片去渐变封面改纯排版 - 交互:hover 细线下划线、标题转斜体、油墨反转,prefers-reduced-motion 降级保留 - 文件处理逻辑 / 文章内容 / deploy 上传脚本未改动 - 附:新增 LLM 系列笔记与配图、Artalk 部署配置、评论组件入库
119 lines
3.5 KiB
Text
119 lines
3.5 KiB
Text
---
|
|
import BaseLayout from '../layouts/BaseLayout.astro';
|
|
import { getPublishedPosts, groupByYear, formatDateShort } from '../lib/utils';
|
|
|
|
const all = await getPublishedPosts();
|
|
const years = groupByYear(all);
|
|
const total = all.length;
|
|
---
|
|
|
|
<BaseLayout title="归档" description="按时间线浏览所有文章">
|
|
<section class="container" style="padding-top: calc(var(--nav-h) + clamp(48px, 8vw, 96px)); padding-bottom: clamp(64px, 8vw, 120px);">
|
|
<header class="page-head reveal">
|
|
<h1 class="page-title">归档</h1>
|
|
<p class="page-sub">共 {total} 篇 · 按年份装订</p>
|
|
</header>
|
|
|
|
<div class="timeline">
|
|
{years.map(({ year, posts }) => (
|
|
<section class="year-group reveal">
|
|
<header class="year-head">
|
|
<span class="year-num">{year}</span>
|
|
<span class="year-rule" aria-hidden="true"></span>
|
|
<span class="year-count">{posts.length} 篇</span>
|
|
</header>
|
|
<div class="year-items">
|
|
{posts.map((p) => (
|
|
<a href={`/posts/${p.id}`} class="tl-item">
|
|
<span class="tl-date">{formatDateShort(p.data.date)}</span>
|
|
<span class="tl-title">{p.data.title}</span>
|
|
{p.data.tags[0] && <span class="chip">{p.data.tags[0]}</span>}
|
|
</a>
|
|
))}
|
|
</div>
|
|
</section>
|
|
))}
|
|
</div>
|
|
</section>
|
|
</BaseLayout>
|
|
|
|
<style>
|
|
.page-head { margin-bottom: clamp(36px, 5vw, 56px); }
|
|
.page-title {
|
|
font-family: var(--font-display);
|
|
font-weight: 400;
|
|
font-size: clamp(2.5rem, 1rem + 5vw, 4.5rem);
|
|
letter-spacing: -0.03em;
|
|
line-height: 1.05;
|
|
color: var(--ink);
|
|
}
|
|
.page-sub { color: var(--ink-60); margin-top: 14px; font-size: 0.9rem; letter-spacing: 0.05em; }
|
|
|
|
/* 年份:巨型衬线年号 + 细线延伸 */
|
|
.year-group { margin-bottom: clamp(40px, 6vw, 72px); }
|
|
.year-head {
|
|
display: flex;
|
|
align-items: baseline;
|
|
gap: 20px;
|
|
margin-bottom: 8px;
|
|
}
|
|
.year-num {
|
|
font-family: var(--font-display);
|
|
font-weight: 400;
|
|
font-size: clamp(2rem, 1rem + 3vw, 3.25rem);
|
|
letter-spacing: -0.02em;
|
|
line-height: 1;
|
|
color: var(--ink);
|
|
}
|
|
.year-rule { flex: 1; height: 1px; background: var(--line); align-self: center; }
|
|
.year-count {
|
|
font-size: 0.72rem;
|
|
letter-spacing: 0.2em;
|
|
text-transform: uppercase;
|
|
color: var(--ink-40);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* 条目:期刊目录行,细线分隔 */
|
|
.year-items { display: flex; flex-direction: column; }
|
|
.tl-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 18px;
|
|
padding: 15px 10px;
|
|
border-bottom: 1px solid var(--line);
|
|
transition: background-color 0.3s, padding-left 0.3s;
|
|
}
|
|
.tl-item:first-child { border-top: 1px solid var(--line); }
|
|
.tl-item:hover { background: rgba(28, 28, 28, 0.02); }
|
|
.tl-date {
|
|
font-family: var(--font-mono);
|
|
font-size: 0.74rem;
|
|
letter-spacing: 0.08em;
|
|
color: var(--ink-40);
|
|
width: 88px;
|
|
flex-shrink: 0;
|
|
}
|
|
.tl-title {
|
|
font-family: var(--font-display);
|
|
font-weight: 400;
|
|
font-size: 1.05rem;
|
|
letter-spacing: -0.01em;
|
|
color: var(--ink);
|
|
flex: 1;
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
transition: all 0.5s;
|
|
}
|
|
.tl-item:hover .tl-title { font-style: italic; }
|
|
.tl-item .chip { margin-left: auto; flex-shrink: 0; }
|
|
|
|
@media (max-width: 640px) {
|
|
.tl-item { flex-wrap: wrap; gap: 8px 14px; }
|
|
.tl-date { width: auto; }
|
|
.tl-title { white-space: normal; }
|
|
.tl-item .chip { margin-left: 0; }
|
|
}
|
|
</style>
|