Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 2 additions & 1 deletion packages/core/src/Site/SiteGenerationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -881,12 +881,13 @@ export class SiteGenerationManager {
try {
const { createIndex, close } = pagefind;

const logsPath = path.join(this.rootPath, '_markbind', 'logs');
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
6 changes: 3 additions & 3 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('/tmp/test', '_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('/tmp/test', '_markbind', 'logs', 'pagefind.log'),
excludeSelectors: ['.no-index', '#sidebar'],
});
Comment thread
yihao03 marked this conversation as resolved.

Expand Down Expand Up @@ -311,7 +311,7 @@ describe('SiteGenerationManager', () => {
{ pageConfig: { resultPath: path.join(outputPath, 'page2.html'), searchable: true } },
] as any;

await generationManagerOnePage.indexSiteWithPagefind();
await generationManagerOnePage.indexSiteWithPagefind('/tmp/test/_markbind/logs');
Comment thread
yihao03 marked this conversation as resolved.
Outdated

expect(mockIndex.addHTMLFile).toHaveBeenCalledTimes(1);
expect(mockIndex.addHTMLFile).toHaveBeenCalledWith({
Expand Down
Loading