You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am overwhelmed by the amount of ways to do things with svelte/sveltekit/vite/mdsvex so am looking for some feedback. I just want to use the recommended enhanced-img throughout my blog. I am no frontend/fullstack dev.
I had initially set up my blog with all images in the /static dir. I would use them like this:
markdown frontmatter
figure: /path/in/static/dir
markdown content

OR
<img src="/path/in/static/dir" class="some-custom-class-for-css">
.svelte
{#each posts as post}
<img src={post.figure} />
{/each}
I tried using @sveltejs/enhanced-img and mdsvex-enhanced-images to do the migration.
For markdown, I could only get this part to work by moving the images to src/lib/assets/images (which seemed like a good idea based on this) and:
I could not get any of the other approaches to work with enhanced-img. After countless hours of searching, it would seem enhanced-img just doesn't work dynamically (so with the path from mdsvex-parsed-markdown)? And mdsvex-enhanced-images does not work with static?
So is this migration just a lost cause?
I'd appreciate any feedback on how you'd proceed if you were me.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am overwhelmed by the amount of ways to do things with svelte/sveltekit/vite/mdsvex so am looking for some feedback. I just want to use the recommended
enhanced-img
throughout my blog. I am no frontend/fullstack dev.I had initially set up my blog with all images in the
/static
dir. I would use them like this:I tried using
@sveltejs/enhanced-img
andmdsvex-enhanced-images
to do the migration.For markdown, I could only get this part to work by moving the images to
src/lib/assets/images
(which seemed like a good idea based on this) and:
=>
I could not get any of the other approaches to work with
enhanced-img
. After countless hours of searching, it would seemenhanced-img
just doesn't work dynamically (so with the path from mdsvex-parsed-markdown)? Andmdsvex-enhanced-images
does not work with static?So is this migration just a lost cause?
I'd appreciate any feedback on how you'd proceed if you were me.
Beta Was this translation helpful? Give feedback.
All reactions