As it stands, the top navigation is mostly static. Whenever we want to make a change to a top-level link, we have to edit a bunch of HTML templates, then regenerate every page that uses those templates, which is time-consuming and error-prone. Before we implemented the dynamic dropdown component of the top nav, any change required this rigmarole.
That sucks, right? There has to be a better way.
There is! By taking advantage of the dynamic data we load into these static pages, we can load top-level links, and their dropdown links, from a JSON file. At first, this had us worried about SEO (which is why we created a dynamic dropdown to start), but after reading some of Google’s documentation on the topic, we’re not so worried about it. It’s something to keep an eye on, to be sure, but not something we have to work around and lose sleep over.
This has several advantages, the greatest advantage being that we can react to the needs of our readers. For example, the Rust programming language is getting super-popular these days (I spent a weekend learning it, in part, a few weeks ago). Should we add Rust to the top nav? With this new system, why not! It also allows us to highlight top stories, as we have in the past, on our old system, as well as any campaigns we’re running (like we did with the Noonies recently).
Overall, we’re looking forward to making more of these pages more dynamic (well, as dynamic as a static CDN page can get ). In the future, you can look forward to more curation, and better curation, as we make progress here.