Skip to content

Commit 903f6a0

Browse files
authored
Add urlPath and correct src source
1 parent 90f8613 commit 903f6a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

_includes/shortcodes/avatar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ module.exports = async (src, alt, className, outputFormat = 'jpeg') => {
1111
const stats = await Image(src, {
1212
cacheDuration: '12w',
1313
formats: [outputFormat],
14+
urlPath: '/assets/avatar/',
1415
outputDir: '_site/assets/avatar/',
1516
widths: [96],
1617
});
1718

1819
const props = stats[outputFormat].pop();
1920

20-
return `<img ${classAttr} src="${props.outputPath.replace('_site', '')}" alt="${alt}" loading="lazy">`;
21+
return `<img ${classAttr} src="${props.url}" alt="${alt}" loading="lazy">`;
2122
} catch (err) {
2223
// eslint-disable-next-line no-console
2324
console.error(err);

0 commit comments

Comments
 (0)