DEV Community

Cover image for Day 05 - Rewriting my Blog in Svelte + Stuck in adding Images
Sourav Yadav
Sourav Yadav

Posted on

1

Day 05 - Rewriting my Blog in Svelte + Stuck in adding Images

Hey devs! πŸ‘‹

Today was about rewriting parts of my original HTML blog using Svelte and trying to build a simple CLI to convert Markdown to HTML β€” ran into a few snags but learned a lot.

🎯 What's my Goal today?

  • Start rewriting my blog using Svelte.
  • Make reusable components like Navbar, ContentBox, Header, and Footer.
  • Build a basic Markdown-to-HTML CLI tool in JavaScript.

🧩 Problems I Faced

  • Got stuck trying to add images when converting markdown. For some reason, the paths break and they don’t show up in the generated HTML. Still need to debug that.
  • Routing in Svelte only works with use:link. If I directly go to /post/day05, it gives a 404. Guess I need to configure the dev server or use hash routing properly.

πŸ’‘ What I Learned

  • Using <slot /> and reusable Svelte components makes everything cleaner and modular.
  • Started building a small CLI in Node.js to turn .md files into HTML pages β€” super handy for my blog posts.
  • CLI tools feel like mini magic β€” even a simple one is exciting to build and see work.

πŸ“Έ Sneak Peek

Rewriting and creating components for svelte

Trying svelte to render html for each item in the array

Still fixing images and routing β€” but overall, good progress today!


Let’s connect if you're building your blog or experimenting with Svelte too:

Top comments (0)