fix: small reworks on git log sidebar

This commit is contained in:
2026-02-21 22:29:06 +01:00
parent 03e813f1a9
commit 2a83df1962
8 changed files with 174 additions and 4 deletions

View File

@@ -264,6 +264,34 @@ describe('BlogGenerationEngine', () => {
expect(singleContentIndex).toBeGreaterThan(singleMenuIndex);
});
it('renders menu on generated category and tag archive pages', async () => {
const posts = [
makePost({
id: '1',
slug: 'news-post',
title: 'News Post',
categories: ['news'],
tags: ['dev'],
createdAt: new Date('2025-03-15T10:00:00Z'),
}),
];
await generate(posts, {
menu: {
items: [
{ id: 'home', title: 'Home', kind: 'home', pageSlug: 'home', children: [] },
{ id: 'news', title: 'News', kind: 'category-archive', categoryName: 'news', children: [] },
],
},
});
const categoryHtml = await readFile(path.join(tempDir, 'html', 'category', 'news', 'index.html'), 'utf-8');
const tagHtml = await readFile(path.join(tempDir, 'html', 'tag', 'dev', 'index.html'), 'utf-8');
expect(categoryHtml).toContain('class="blog-menu"');
expect(tagHtml).toContain('class="blog-menu"');
});
it('copies all required asset files to html/assets/ and html/images/', async () => {
const result = await generate([]);