Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/core/src/Site/SiteGenerationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -881,12 +881,14 @@ export class SiteGenerationManager {
try {
const { createIndex, close } = pagefind;

const logsPath = path.join(this.rootPath, '_markbind', 'logs');
await fs.ensureDir(logsPath);
const pagefindConfig = this.siteConfig.pagefind || {};

const createIndexOptions: Record<string, unknown> = {
keepIndexUrl: true,
verbose: true,
logfile: 'debug.log',
logfile: path.join(logsPath, 'pagefind.log'),
};
Comment thread
yihao03 marked this conversation as resolved.

if (pagefindConfig.exclude_selectors) {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/unit/Site/SiteGenerationManager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ describe('SiteGenerationManager', () => {
expect(pagefindSpy).toHaveBeenCalledWith({
keepIndexUrl: true,
verbose: true,
logfile: 'debug.log',
logfile: path.join(rootPath, '_markbind', 'logs', 'pagefind.log'),
});
Comment thread
yihao03 marked this conversation as resolved.

pagefindSpy.mockRestore();
Expand Down Expand Up @@ -167,7 +167,7 @@ describe('SiteGenerationManager', () => {
expect(pagefindSpy).toHaveBeenCalledWith({
keepIndexUrl: true,
verbose: true,
logfile: 'debug.log',
logfile: path.join(rootPath, '_markbind', 'logs', 'pagefind.log'),
excludeSelectors: ['.no-index', '#sidebar'],
});
Comment thread
yihao03 marked this conversation as resolved.

Expand Down
Loading