fix: harmonize main page with rest of site
This commit is contained in:
@@ -574,7 +574,7 @@ export class BlogGenerationEngine {
|
|||||||
if (pagePosts.length === 0) break;
|
if (pagePosts.length === 0) break;
|
||||||
|
|
||||||
const html = await pageRenderer.renderPostList(pagePosts, rewriteContext, {
|
const html = await pageRenderer.renderPostList(pagePosts, rewriteContext, {
|
||||||
archiveGrouping: false,
|
archiveGrouping: true,
|
||||||
routeKind: 'date',
|
routeKind: 'date',
|
||||||
archiveContext: { kind: 'root' },
|
archiveContext: { kind: 'root' },
|
||||||
basePathname: '/',
|
basePathname: '/',
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ export class PreviewServer {
|
|||||||
if (pagedPathname === '/') {
|
if (pagedPathname === '/') {
|
||||||
const result = await this.loadPublishedSnapshotsPage({ status: 'published' }, pageOptions);
|
const result = await this.loadPublishedSnapshotsPage({ status: 'published' }, pageOptions);
|
||||||
return this.pageRenderer.renderPostList(result.posts, rewriteContext, {
|
return this.pageRenderer.renderPostList(result.posts, rewriteContext, {
|
||||||
archiveGrouping: false,
|
archiveGrouping: true,
|
||||||
routeKind: 'date',
|
routeKind: 'date',
|
||||||
archiveContext: { kind: 'root' },
|
archiveContext: { kind: 'root' },
|
||||||
basePathname: pagedPathname,
|
basePathname: pagedPathname,
|
||||||
|
|||||||
@@ -195,8 +195,8 @@ describe('BlogGenerationEngine', () => {
|
|||||||
|
|
||||||
it('generates root index.html for published posts', async () => {
|
it('generates root index.html for published posts', async () => {
|
||||||
const posts = [
|
const posts = [
|
||||||
makePost({ id: '1', slug: 'first', title: 'First 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' }),
|
makePost({ id: '2', slug: 'second', title: 'Second Post', createdAt: new Date('2025-01-14T10:00:00Z') }),
|
||||||
];
|
];
|
||||||
|
|
||||||
const result = await generate(posts);
|
const result = await generate(posts);
|
||||||
@@ -209,6 +209,9 @@ describe('BlogGenerationEngine', () => {
|
|||||||
expect(html).toContain('data-template="post-list"');
|
expect(html).toContain('data-template="post-list"');
|
||||||
expect(html).toContain('/assets/pico.min.css');
|
expect(html).toContain('/assets/pico.min.css');
|
||||||
expect(html).toContain('/assets/lightbox.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 () => {
|
it('generates single post pages at /{year}/{month}/{day}/{slug}/index.html', async () => {
|
||||||
|
|||||||
@@ -152,6 +152,9 @@ describe('PreviewServer', () => {
|
|||||||
const html = await response.text();
|
const html = await response.text();
|
||||||
expect(html).toContain('<div class="post">');
|
expect(html).toContain('<div class="post">');
|
||||||
expect(html).toContain('<h1>Newest</h1>');
|
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 () => {
|
it('uses local CSS/JS assets and serves them from the preview server', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user