Skip to content

Commit 4e87b2b

Browse files
committed
fix inline plugin
1 parent 936e54d commit 4e87b2b

File tree

4 files changed

+374
-1
lines changed

4 files changed

+374
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Go to the `v1` branch to see the changelog of Lume 1.
1313
- Ignore `deno.json` and `deno.jsonc` files by the watcher.
1414

1515
### Fixed
16+
- `inline` plugin: Error when basePath plugin is used before.
1617
- `icons` plugin: clear the plugin list on update.
1718
- Updated dependencies: `vento`, `satori`, `sharp`, `esbuild`, `deno-loader`, `sass` and some icons.
1819

plugins/inline.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ export function inline(userOptions?: Options) {
8484
}
8585

8686
async function readContent(url: string, asDataUrl: boolean) {
87-
const path = getPath(site.options.location.pathname, url);
87+
const { pathname } = site.options.location;
88+
const path = url.startsWith(pathname)
89+
? posix.join("/", url.slice(pathname.length))
90+
: url;
8891
const content = await getFileContent(site, path, asDataUrl);
8992

9093
// Return the raw content or undefined if the file is not found

0 commit comments

Comments
 (0)