Treat everything like a Page #6
Replies: 1 comment 13 replies
-
Will chew on this more, but on the bundles: This actually might be really good to make a city landing page with the idea of changing the top level taxonomy to city vs year, with each year highlighted. So each city gets a permanent spot on an easy-to-find page; no more digging to find the city you want that might not have their year up. And then someone coming to sponsor or speak can pick the city and see at a glance which year is current (or whether you had your event yet). And that would also help with (1) I want to start a DevOpsDays in my city but I can't find a past example and (2) you can put high-level details about your city there. So, for example, for Austin I might put down a bit about our demographics and that we always have our event in May. |
Beta Was this translation helpful? Give feedback.
-
Much of the logic/structure in this theme is heavily dependent upon data files, and a lot of inefficient queries. Modern Hugo treats every element as a Page object, which drives more of the information into the frontmatter elements instead of where we do it with a lot of looping queries based upon file locations. I suspect we could get more efficiency by pushing things down to the Page levels
Page Bundles
Here's what I wrote on this topic in 2020:
I wrote some code back in 2020 that implemented this, and I don't recall all the discoveries that I came up with, but I'll do some digging and update this thread with what I find.
File structure
I have made the argument before that the filesystem for a lot of this is unwieldy. Of course changes to the paths for events would need to be handled with redirects or alias so that old URLs don't break. But for example, I see something like this:
So what you have there is a generated path of
devopsdays.org/events/2020/ponyville
which would want to make sure to have redirects created for backward-compatibility so thatdevopsdays.org/events/2020-ponyville
still works.The
data
directory has already been refactored to fit this model, so this would keep them parallel.Alternatively, we could have
city
be the top level with subdirectories for the years, as mentioned in Taxonomy and layout discussion.Migrate from data files to Page frontmatter
Again, here's words I wrote back in 2020. Similar to Bundles, i did work with this. There are some challenges with it, which I'll list some of them after this and others later.
One thing that came up with this was that our use of date/time in the data files is very lenient, which doesn't translate well to a proper date/time in Hugo frontmatter. I wrote migrator to convert the data files to page frontmatter, but what i found was that I kept having to wait for it to spin and find a file with a malformed date, etc, and error out - at which point i would go and "fix" it in the source data file and then have to run migrator again. I suppose error checking in
migrator
would help this. It's not a reason to not do it though.Change Program template to use Pages
Again, words I wrote in 2020. From what I can tell from devopsdays/devopsdays-web#9839, it was actually not that bad (at least in implementation; the
migrator
tool never got updated to migrate programs)More info on all these topics this and things I learned from doing it can be found here - #4
Beta Was this translation helpful? Give feedback.
All reactions