Skip to content

Commit ebffcbf

Browse files
authored
Move pagefind log output to logs folder (#2897)
1 parent 79c1860 commit ebffcbf

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎packages/core/src/Site/SiteGenerationManager.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,12 +881,14 @@ export class SiteGenerationManager {
881881
try {
882882
const { createIndex, close } = pagefind;
883883

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

886888
const createIndexOptions: Record<string, unknown> = {
887889
keepIndexUrl: true,
888890
verbose: true,
889-
logfile: 'debug.log',
891+
logfile: path.join(logsPath, 'pagefind.log'),
890892
};
891893

892894
if (pagefindConfig.exclude_selectors) {

‎packages/core/test/unit/Site/SiteGenerationManager.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ describe('SiteGenerationManager', () => {
138138
expect(pagefindSpy).toHaveBeenCalledWith({
139139
keepIndexUrl: true,
140140
verbose: true,
141-
logfile: 'debug.log',
141+
logfile: path.join(rootPath, '_markbind', 'logs', 'pagefind.log'),
142142
});
143143

144144
pagefindSpy.mockRestore();
@@ -167,7 +167,7 @@ describe('SiteGenerationManager', () => {
167167
expect(pagefindSpy).toHaveBeenCalledWith({
168168
keepIndexUrl: true,
169169
verbose: true,
170-
logfile: 'debug.log',
170+
logfile: path.join(rootPath, '_markbind', 'logs', 'pagefind.log'),
171171
excludeSelectors: ['.no-index', '#sidebar'],
172172
});
173173

0 commit comments

Comments
 (0)