In this episode, we revisit how we manage page titles in our app, especially after bringing server-side rendering into the mix. We start by looking at how we were setting unique titles for each individual page, which is a bit tedious and not very maintainable if our app name ever changes.
To make things easier, we improve our setup so that all our pages use a default format for titles (like "Page Name - co-course"), all set from one place—app.js
. This way, if we need to change our app’s name or how titles are structured, we just update it once.
We also add some simple logic so that if a page doesn’t set a title, it’ll default to just the app’s name. Plus, we make sure this logic works for both client-side and server-side rendering, updating ssr.js
in the same way. By the end, our titles are dynamic, consistent, and easy to manage—no more manual updates on every page.