feat: каркас v2 — Astro 5 + миграция 50 постов из WP + RSS для IPB Importer

- Astro 5 (6.3.6) minimal scaffold с Content Collections для posts/pages
- Тёмная палитра в духе старой темы darkness-10 (тонкая типографика Inter+Lora)
- Layout с шапкой/футером, главной-лентой, страницами категорий и одиночными постами
- RSS (общий + per-category) под IPB RSS Importer: RFC-822 pubDate,
  <guid isPermaLink="true">, <content:encoded> с CDATA, <lastBuildDate>
- RSS_CUTOFF фильтр: архив 2009-2015 на сайте остаётся, в RSS — только новые
- 50 постов и 6 страниц мигрированы из WP (anotherreflctions_ru @ db.hhivp.com)
  через scripts/migrate-wp.mjs (HTML→md без внешних зависимостей)
- sitemap.xml автоматически через @astrojs/sitemap
This commit is contained in:
2026-05-21 00:58:44 +03:00
parent b458cc6fa3
commit 0c3e248ccc
79 changed files with 8345 additions and 132 deletions

47
src/pages/index.astro Normal file
View File

@@ -0,0 +1,47 @@
---
import { getCollection } from 'astro:content';
import BaseLayout from '../layouts/BaseLayout.astro';
import { FORUMS } from '../consts';
const posts = (await getCollection('posts'))
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf());
const fmtDate = (d: Date) =>
d.toLocaleDateString('ru-RU', { year: 'numeric', month: 'long', day: 'numeric' });
---
<BaseLayout>
<section>
<h1>Новости</h1>
<ul class="post-list">
{posts.map((post) => (
<li class="post-list-item">
<div class="post-meta">
<time datetime={post.data.pubDate.toISOString()}>{fmtDate(post.data.pubDate)}</time>
{post.data.categories.length > 0 && (
<>
{' · '}
{post.data.categories.map((cat, i) => (
<>
{i > 0 && ', '}
<a href={`/category/${post.data.categorySlugs[i]}/`}>{cat}</a>
</>
))}
</>
)}
</div>
<h2><a href={`/${post.data.slug}/`}>{post.data.title}</a></h2>
{post.data.description && <p class="post-excerpt">{post.data.description}…</p>}
</li>
))}
</ul>
</section>
<section id="forums">
<h2>Форумы и проекты</h2>
<ul class="forums-grid">
{FORUMS.map((f) => (
<li><a href={f.url} target="_blank" rel="noopener">{f.name}</a></li>
))}
</ul>
</section>
</BaseLayout>