mirror of
https://github.com/CompeyDev/blog.devcomp.xyz.git
synced 2024-12-12 12:50:41 +00:00
Attempt to fix relative img path bug
This commit is contained in:
parent
40f3fb1c8e
commit
472cba451a
1 changed files with 2 additions and 2 deletions
|
@ -22,7 +22,7 @@ const isLocal = !(
|
||||||
src.startsWith("https") ||
|
src.startsWith("https") ||
|
||||||
src.startsWith("data:")
|
src.startsWith("data:")
|
||||||
);
|
);
|
||||||
const isPublic = src.startsWith("/");
|
// const isPublic = src.startsWith("/");
|
||||||
|
|
||||||
// TODO temporary workaround for images dynamic import
|
// TODO temporary workaround for images dynamic import
|
||||||
// https://github.com/withastro/astro/issues/3373
|
// https://github.com/withastro/astro/issues/3373
|
||||||
|
@ -43,6 +43,6 @@ const imageStyle = `object-position: ${position}`;
|
||||||
<div id="image-wrapper" class:list={[className, 'overflow-hidden relative']}>
|
<div id="image-wrapper" class:list={[className, 'overflow-hidden relative']}>
|
||||||
<div class="transition absolute inset-0 dark:bg-black/10 bg-opacity-50 pointer-events-none"></div>
|
<div class="transition absolute inset-0 dark:bg-black/10 bg-opacity-50 pointer-events-none"></div>
|
||||||
{isLocal && <img src={optimizedImg!.src} alt={alt || ""} class={imageClass} style={imageStyle}/>}
|
{isLocal && <img src={optimizedImg!.src} alt={alt || ""} class={imageClass} style={imageStyle}/>}
|
||||||
{!isLocal && <img src={isPublic ? url(src) : src} alt={alt || ""} class={imageClass} style={imageStyle}/>}
|
{!isLocal && <img src={url(src)} alt={alt || ""} class={imageClass} style={imageStyle}/>}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue