ワンクリックで
news-system
How the Latest News homepage section works — adding news items, managing the API, and understanding the architecture.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
How the Latest News homepage section works — adding news items, managing the API, and understanding the architecture.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | news-system |
| description | How the Latest News homepage section works — adding news items, managing the API, and understanding the architecture. |
The homepage features a "Latest News" section that aggregates content from two sources:
src/posts/ with news: true in frontmatterhttps://pauseai.substack.com/feedsrc/routes/api/news/+server.ts → API endpoint (fetches, merges, paginates)
src/lib/components/LatestNews.svelte → Section component (grid + pagination)
src/lib/components/NewsCard.svelte → Individual card component
src/lib/types.ts → NewsItem type definition
LatestNews.svelte fetches /api/news?page=1&pageSize=6 on mountgetInternalNews() and getSubstackNews() in parallel{ items, total, page, pageSize, totalPages }Add news: true to any markdown post's frontmatter. Optionally add an image field for a banner:
---
title: My News Post
description: A brief summary of the news.
date: 2026-02-18
image: /my-image.png
news: true
---
image will appear as a card thumbnail in the news grid AND as a banner on the post pagestatic/ and referenced with a leading /image get an orange gradient fallback in the news griddescription field is used as the card subtitleSimply remove news: true from the post's frontmatter (or set it to false). The post will still exist as a regular page but won't appear in the news grid.
GET /api/news
| Param | Default | Description |
|---|---|---|
page | 1 | Page number (1-indexed) |
pageSize | 6 | Items per page (max 12) |
The endpoint decodes HTML entities from Substack RSS (e.g., ’ → ').
rel="noopener noreferrer"NewsItem type uses a discriminated union: items have either slug (internal) or href (external), never bothdata-pagefind-ignore to exclude it from site searchThe Substack feed is fetched server-side from https://pauseai.substack.com/feed. Items are parsed from RSS XML using regex extraction for:
<title> → card title<description> → card subtitle<link> → card href<pubDate> → card date<enclosure url="..."> → card imageNo Substack API key is needed — the RSS feed is public.