Skip to content

Commit

Permalink
fix ondemand
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Nov 18, 2024
1 parent 05d3fd0 commit d2a1350
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Go to the `v1` branch to see the changelog of Lume 1.
### Fixed
- Ensure `LUME_LIVE_RELOAD` env variable is available in the _config file.
- `on_demand` middleware types.
- `on_demand` plugin doesn't filter scoped pages.
- Updates dependencies: `std`, `sass`, `postcss`, `decap-cms` and some icons.

## [2.4.2] - 2024-11-10
Expand Down
5 changes: 3 additions & 2 deletions core/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,9 @@ export default class Site {

// Get the site content
const [pages] = await this.source.build(
(entry) =>
(entry.type === "directory" && file.startsWith(entry.path)) ||
(entry, page) =>
(entry.type === "directory" && file.startsWith(entry.path) && (!page ||
page.sourcePath === file)) ||
entry.path === file,
);

Expand Down
4 changes: 4 additions & 0 deletions core/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ export default class Source {
page.data.url = url;
page.data.date = getPageDate(page);
page.data.page = page;

if (buildFilters.some((filter) => !filter(dir, page))) {
continue;
}
pages.push(page);
}
}
Expand Down

0 comments on commit d2a1350

Please sign in to comment.