Skip to content

Commit e4a98be

Browse files
authored
Merge pull request #563 from scarf005/arrow
feat: more visually distinct log for url transformation
2 parents b642ebd + f9b39b9 commit e4a98be

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Go to the `v1` branch to see the changelog of Lume 1.
2929
- Default ico size changed to 48.
3030
- Add `sizes="any"` to the svg icon.
3131
- Place the svg icon at end.
32+
- logging: URL transformation direction is more visually distinct.
3233

3334
### Fixed
3435
- Pages filtered with `filter_pages` plugin are exported to the sitemap.

core/utils/log.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
bold,
55
brightGreen,
66
cyan,
7+
gray,
78
dim,
89
red,
910
strikethrough,
@@ -71,6 +72,7 @@ const logFormats: Record<string, (str: string) => string> = {
7172
Cyan: (str: string) => bold(cyan(str)),
7273
red,
7374
Red: (str: string) => bold(red(str)),
75+
gray,
7476
dim,
7577
Dim: (str: string) => bold(dim(str)),
7678
green: brightGreen,

core/writer.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class FSWriter implements Writer {
8787
}
8888
}
8989

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

9292
const filename = posix.join(this.dest, page.outputPath);
9393
await ensureDir(posix.dirname(filename));
@@ -143,11 +143,10 @@ export class FSWriter implements Writer {
143143
// Copy file https://github.com/denoland/deno/issues/19425
144144
Deno.writeFileSync(pathTo, Deno.readFileSync(entry.src));
145145
}
146-
log.info(
147-
`🔥 ${file.outputPath} <dim>${
148-
entry.flags.has("remote") ? entry.src : entry.path
149-
}</dim>`,
150-
);
146+
log.info(fmt({
147+
from: entry.flags.has("remote") ? entry.src : entry.path,
148+
to: file.outputPath,
149+
}));
151150
return true;
152151
} catch {
153152
// Ignored

0 commit comments

Comments
 (0)