Website relaunch, Notion, and ‘why Svelte’

Rewriting my website using Svelte Kit and Notion

originally published Wed Oct 26 2022 00:00:00 GMT+0000 (Coordinated Universal Time)

I’ve been working on the relaunch of my site in Svelte Kit for a worrying amount of time!

Website 1.0

The original version of this site of mine was written using Gridsome, about 4 years or so ago.

At the time I was going through a huge Vue phase. I still love Vue, but it’s not my first pick for personal projects these days.

When I first tried Svelte, my reaction was “wow, this is just how you imagine components on the web should work.” There are some detractors that decry the magic behind Svelte’s compiler, but that is what makes everything possible. The compiler allows Svelte to use an extremely simple syntax for state changes in your frontend.

<script>
  let count = 0

  const click = () => {
    count += 1
  }
</script>

<button on:click={click}>
  clicks: {count}
</button>

The ‘hello world’ of frontend components: a counter button, in Svelte.

That’s all there is to it. You define the variable, and you mutate the variable.