Skip to content
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,3 @@ jobs:

- name: Build
run: pnpm build

- name: Install Playwright browser
run: pnpm exec playwright install --with-deps chromium

- name: Smoke tests
run: pnpm test:smoke
34 changes: 34 additions & 0 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: smoke

on:
workflow_dispatch:

jobs:
smoke:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.6.5

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Prepare local env
run: cp .env.example .env

- name: Install Playwright browser
run: pnpm exec playwright install --with-deps chromium

- name: Smoke tests
run: pnpm test:smoke
11 changes: 5 additions & 6 deletions apps/api/src/lib/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,12 @@ export const getPublicSiteConfig = async () => {
secondaryDomain: payload.settings.secondaryDomain,
mediaDomain: payload.settings.mediaDomain,
navigation: [
{ label: 'Home', href: '/' },
{ label: 'About', href: '/about' },
{ label: '首页', href: '/' },
{ label: '极客日报', href: '/geekdaily' },
{ label: 'Who-Is-Hiring', href: '/who-is-hiring' },
{ label: 'GeekDaily', href: '/geekdaily' },
{ label: 'Articles', href: '/articles' },
{ label: 'Events', href: '/events' },
{ label: 'Contributors', href: '/contributors' },
{ label: '活动', href: '/events' },
{ label: '贡献者们', href: '/contributors' },
{ label: '关于Rebase', href: '/about' },
],
socialLinks: payload.settings.socialLinks,
footerGroups: payload.settings.footerGroups,
Expand Down
127 changes: 47 additions & 80 deletions apps/web/src/pages/geekdaily/[slug].astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
import BaseLayout from '@/layouts/BaseLayout.astro';
import DetailHero from '@/components/DetailHero.astro';
import DetailSidebarLinksSection from '@/components/DetailSidebarLinksSection.astro';
import MarkdownContent from '@/components/MarkdownContent.astro';
import { getGeekDailyEpisodeBySlug, getGeekDailyEpisodes, getSiteSettings } from '@/lib/content';
Expand All @@ -13,8 +12,12 @@ const geekDailyTemplateOutro =
const extractGeekDailyBodyNote = (bodyMarkdown: string) => {
const normalized = bodyMarkdown.trim();

if (!normalized || !normalized.endsWith(geekDailyTemplateOutro)) {
return normalized;
if (!normalized) {
return '';
}

if (!normalized.endsWith(geekDailyTemplateOutro)) {
return '';
}

const outroMarker = `\n\n---\n\n${geekDailyTemplateOutro}`;
Expand All @@ -33,34 +36,6 @@ const slug = Astro.params.slug ?? '';
const [site, episode, episodes] = await Promise.all([getSiteSettings(), getGeekDailyEpisodeBySlug(slug), getGeekDailyEpisodes()]);
const related = episode ? episodes.filter((item) => item.slug !== episode.slug).slice(0, 2) : [];
const episodeNote = episode ? extractGeekDailyBodyNote(episode.body) : '';
const episodeBreadcrumbs = episode
? [
{ href: '/', label: '首页' },
{ href: '/geekdaily', label: 'GeekDaily' },
{ label: episode.title, current: true },
]
: [];
const episodeHeroMeta = episode
? [
formatDate(episode.publishedAt),
`${episode.items.length} 条推荐`,
episode.editors.length > 0 ? `${episode.editors.length} 位编辑` : '持续归档',
]
: [];
const episodeHeroActions = [
{ href: '/geekdaily/rss.xml', label: '订阅 GeekDaily RSS', showIcon: true },
{ href: '/geekdaily', label: '回到 GeekDaily 列表', secondary: true },
];
const episodeJumpLinks = [
{ href: '#episode-body', label: '进入正文' },
{ href: '#episode-items', label: '推荐条目' },
{ href: '#episode-info', label: '期数信息' },
];
const episodeWayfindingLinks = [
{ href: '#episode-body', label: '进入正文' },
{ href: '#episode-items', label: '查看推荐条目' },
{ href: '#episode-info', label: '查看期数信息' },
];
const episodeActionLinks = [
{ href: '/geekdaily/rss.xml', label: '订阅 GeekDaily RSS' },
{ href: '/geekdaily', label: '回到 GeekDaily 列表' },
Expand All @@ -83,37 +58,23 @@ if (!episode) {
>
{episode ? (
<>
<section class="shell page-hero single">
<DetailHero
kicker="GeekDaily 详情"
breadcrumbs={episodeBreadcrumbs}
edition={`No. ${episode.episodeNumber}`}
title={episode.title}
summary={episode.summary}
meta={episodeHeroMeta}
note="这期内容既保留正文,也把逐条推荐保留下来,方便搜索、订阅和回看。"
actions={episodeHeroActions}
jumps={episodeJumpLinks}
heroClass="episode-hero"
/>
</section>

<section class="shell page-section detail-shell">
<article id="episode-body" class="card detail-body-card episode-detail">
<div class="detail-body-lead lead">
<p>{formatDate(episode.publishedAt)}</p>
{episode.editors.length > 0 && <p>本期编辑:{episode.editors.join('、')}</p>}
{episode.tags.length > 0 && (
<ul>
{episode.tags.map((tag) => <li>{tag}</li>)}
</ul>
)}
</div>
{episodeNote ? (
<MarkdownContent content={episodeNote} />
) : (
<p class="episode-note-empty">本期内容由结构化推荐条目自动整理,无需额外补充说明。</p>
)}
<header class="episode-head">
<p class="episode-eyebrow">极客日报 #{episode.episodeNumber}</p>
<h1>{episode.title}</h1>
<p class="episode-summary">{episode.summary}</p>
<div class="detail-body-lead lead">
<p>{formatDate(episode.publishedAt)}</p>
{episode.editors.length > 0 && <p>本期编辑:{episode.editors.join('、')}</p>}
{episode.tags.length > 0 && (
<ul>
{episode.tags.map((tag) => <li>{tag}</li>)}
</ul>
)}
</div>
</header>
{episodeNote && <MarkdownContent content={episodeNote} />}
<section id="episode-items" class="item-section">
<h2>本期推荐</h2>
<div class="item-list">
Expand All @@ -139,12 +100,6 @@ if (!episode) {
</article>

<aside class="card detail-sidebar">
<DetailSidebarLinksSection
title="页面导览"
copy="如果你是从搜索或分享链接重新进入,这几个锚点能帮你更快找到正文、条目和订阅入口。"
links={episodeWayfindingLinks}
/>

<section id="episode-info" class="detail-sidebar-section">
<h2>期数信息</h2>
<ul class="detail-fact-list">
Expand Down Expand Up @@ -202,21 +157,35 @@ if (!episode) {
</BaseLayout>

<style>
.single {
grid-template-columns: 1fr;
.episode-head {
display: grid;
gap: 0.75rem;
margin-bottom: 1.5rem;
padding-bottom: 1.35rem;
border-bottom: 1px solid rgba(31, 41, 51, 0.08);
}

.episode-eyebrow {
margin: 0;
color: var(--accent-strong);
font-size: 0.8rem;
font-weight: 800;
letter-spacing: 0.14em;
text-transform: uppercase;
}

.episode-hero {
color: white;
background:
radial-gradient(circle at top right, rgba(245, 158, 11, 0.24), transparent 24%),
linear-gradient(135deg, rgba(67, 32, 14, 0.98), rgba(15, 118, 110, 0.92));
border-color: rgba(255, 255, 255, 0.08);
box-shadow: 0 28px 60px rgba(39, 26, 18, 0.24);
.episode-head h1 {
margin: 0;
font-size: clamp(2rem, 3.4vw, 3rem);
line-height: 1.02;
letter-spacing: -0.035em;
}

.light {
color: white;
.episode-summary {
margin: 0;
max-width: 62ch;
color: var(--muted);
line-height: 1.8;
}

.lead ul {
Expand Down Expand Up @@ -252,7 +221,6 @@ if (!episode) {
font-size: 1.45rem;
}

.episode-note-empty,
.episode-outro {
margin-top: 1.35rem;
padding: 1rem 1.1rem;
Expand All @@ -261,8 +229,7 @@ if (!episode) {
color: rgba(17, 24, 39, 0.82);
}

.episode-outro p,
.episode-note-empty {
.episode-outro p {
margin: 0;
}

Expand Down
Loading
Loading