fix: harmonize main page with rest of site

This commit is contained in:
2026-02-20 19:47:07 +01:00
parent 3bbc5281e8
commit 23facaa36d
4 changed files with 10 additions and 4 deletions

View File

@@ -574,7 +574,7 @@ export class BlogGenerationEngine {
if (pagePosts.length === 0) break;
const html = await pageRenderer.renderPostList(pagePosts, rewriteContext, {
archiveGrouping: false,
archiveGrouping: true,
routeKind: 'date',
archiveContext: { kind: 'root' },
basePathname: '/',

View File

@@ -286,7 +286,7 @@ export class PreviewServer {
if (pagedPathname === '/') {
const result = await this.loadPublishedSnapshotsPage({ status: 'published' }, pageOptions);
return this.pageRenderer.renderPostList(result.posts, rewriteContext, {
archiveGrouping: false,
archiveGrouping: true,
routeKind: 'date',
archiveContext: { kind: 'root' },
basePathname: pagedPathname,

View File

@@ -195,8 +195,8 @@ describe('BlogGenerationEngine', () => {
it('generates root index.html for published posts', async () => {
const posts = [
makePost({ id: '1', slug: 'first', title: 'First Post' }),
makePost({ id: '2', slug: 'second', title: 'Second Post' }),
makePost({ id: '1', slug: 'first', title: 'First Post', createdAt: new Date('2025-01-15T10:00:00Z') }),
makePost({ id: '2', slug: 'second', title: 'Second Post', createdAt: new Date('2025-01-14T10:00:00Z') }),
];
const result = await generate(posts);
@@ -209,6 +209,9 @@ describe('BlogGenerationEngine', () => {
expect(html).toContain('data-template="post-list"');
expect(html).toContain('/assets/pico.min.css');
expect(html).toContain('/assets/lightbox.min.css');
expect(html).toContain('archive-day-marker');
expect(html).toContain('15.01.2025');
expect(html).toContain('14.01.2025');
});
it('generates single post pages at /{year}/{month}/{day}/{slug}/index.html', async () => {

View File

@@ -152,6 +152,9 @@ describe('PreviewServer', () => {
const html = await response.text();
expect(html).toContain('<div class="post">');
expect(html).toContain('<h1>Newest</h1>');
expect(html).toContain('archive-day-marker');
expect(html).toContain('03.01.2025');
expect(html).toContain('02.01.2025');
});
it('uses local CSS/JS assets and serves them from the preview server', async () => {