Skip to content

Commit

Permalink
fix: monolith not embedding SVG files correctly. Fixes #289 (#306)
Browse files Browse the repository at this point in the history
passing in the URL of the page to have the proper URL for resolving relative paths
  • Loading branch information
kamtschatka authored Jul 14, 2024
1 parent a222564 commit aa3dce0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions apps/workers/crawlerWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,15 +422,12 @@ async function archiveWebpage(
jobId: string,
) {
logger.info(`[Crawler][${jobId}] Will attempt to archive page ...`);
const urlParsed = new URL(url);
const baseUrl = `${urlParsed.protocol}//${urlParsed.host}`;

const assetId = newAssetId();
const assetPath = `/tmp/${assetId}`;

await execa({
input: html,
})`monolith - -Ije -t 5 -b ${baseUrl} -o ${assetPath}`;
})`monolith - -Ije -t 5 -b ${url} -o ${assetPath}`;

await saveAssetFromFile({
userId,
Expand All @@ -442,7 +439,7 @@ async function archiveWebpage(
});

logger.info(
`[Crawler][${jobId}] Done archiving the page as assertId: ${assetId}`,
`[Crawler][${jobId}] Done archiving the page as assetId: ${assetId}`,
);

return assetId;
Expand Down

0 comments on commit aa3dce0

Please sign in to comment.