PAVEE.dev

Site Update (2023-10-09): Bug Fixes That Almost Drained My Sanity

09 October 2023 · Updates

So, basically, the site was not updating the title when navigating to different pages. This is likely due to the fact, that in SSR mode, the title is updated inside the layout, not the page itself.

So, when the app is built in SSG mode, these blog post pages with dynamic titles do not know how or when to update their title because, in the Svelte file for each of these pages, there is no "instruction" anywhere. While the "static" pages like the Post List page (the /blog route) only have a single outcome, therefore, the app is able to determine what the title is going to be.

To fix this, I explicitly set the title inside the blog post pages like this:

<svelte:head>
    <title>{data.title} - Pavee.dev</title>
</svelte:head>

Only took me 2 hours. It's no big deal...

AAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHH

Oh, here's the changelog for this update:

  • Made the navigation bar sticky when scrolling away from the top.
  • Integrated Google Analytics.
  • Fixed an issue where blog posts would not set their titles correctly when navigating from other pages.