Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Mar 28, 2024
1 parent 9cb4606 commit d564376
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Go to the `v1` branch to see the changelog of Lume 1.
- Do not ignore the `/.well-known` folder by default [#585].

### Fixed
- Reload site on rename/delete file.
- Updated dependencies: `std`, `esbuild`, `lightningcss`, `unocss`, `date-fns`, `cms`, `eta`, `katex`, `liquid`, `markdown-it`, `postcss`, `postcss-import`, `autoprefixer`, `preact`, `sharp`.

## [2.1.2] - 2024-03-14
Expand Down
2 changes: 1 addition & 1 deletion core/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ export default class Site {
const files = this.files.filter((file) => file.entry === entry).map((
file,
) => file.outputPath);
this.writer.removeFiles([...pages, ...files]);
await this.writer.removeFiles([...pages, ...files]);
}

// Get the site content
Expand Down
8 changes: 5 additions & 3 deletions core/writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ export class FSWriter implements Writer {
return false;
}

const id = outputPath.toLowerCase();
const filename = posix.join(this.dest, outputPath);
const id = filename.toLowerCase();
const hash = await sha1(content);
const previous = this.#outputs.get(id);
this.#outputs.set(id, [this.#saveCount, sourcePath, hash]);
Expand All @@ -89,7 +90,6 @@ export class FSWriter implements Writer {

log.info(`🔥 ${page.data.url} <- <gray>${sourcePath}</gray>`);

const filename = posix.join(this.dest, page.outputPath);
await ensureDir(posix.dirname(filename));

page.content instanceof Uint8Array
Expand Down Expand Up @@ -167,7 +167,9 @@ export class FSWriter implements Writer {
files,
async (file) => {
try {
await Deno.remove(posix.join(this.dest, file));
const outputPath = posix.join(this.dest, file);
this.#outputs.delete(outputPath.toLowerCase());
await Deno.remove(outputPath);
} catch {
// Ignored
}
Expand Down

0 comments on commit d564376

Please sign in to comment.