-
Notifications
You must be signed in to change notification settings - Fork 670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to sort speakers (and maybe also organizers) on pages #9826
Comments
Why not use the weights that Hugo already implements? |
Can you be more specific? |
Ah you mean this the speaker pages aren’t really in a collection in that way, and it doesn’t solve for organizers though. But we might as well use the existing framework for the front matter field and could make the code slightly easier to implement |
That is what I was just looking up. |
Is it probably not a bad idea to use a list template for speakers, the tricky thing is that it changes the page type for speaker pages that already exist so there would be a small maintenance task to go back and change that on all those |
Off the top of my head, doing it, this way would actually probably also help on some data lookups that were currently doing if we are treating speakers as a list, rather than just a bunch of pages! |
Since I’m not doing the big theme, refractor anymore, making a small change to have Organizers be individual pages instead of being in the data file would be a good thing to put as a small change by itself, we would have to have backwards compatibility for the old way, but I think it’s quite doable |
Yes, having json outputs for API like usage has been very helpful in the other HugoIO websites I have build. I will see what I can do to help out. |
Created #13756 for the speaker type |
Folks have asked for the ability to adjust the order of speakers on the Speakers page. I think I can look into providing this ability in the theme refactor.
First guess is that we could do it one of two ways:
Frontmatter on
speakers.md
In this case, there is a new, optional frontmatter element added to the
speakers.md
content file. This would list all the speakers in the order preferred.If this element is detected, instead of spinning through files to find the speakers, it would only use this list, but in that order. The downside of this is that if someone sets this, but add speakers later and forget to update it, they won't show up. But since this is an optional thing and I feel like we would kind of "not advertise" it, most folks won't use it anyway.
So it would look like this:
(for organizers, a similar frontmatter element of
Organizers = ["",""]
would be added to thecontact.md
file for the event)Frontmatter in
speakers/firstname-lastname.md
For this method, each speaker (or organizer[1]) file would have an optional "sort" parameter in their frontmatter, and when we range to get those pages, we sort based on that value.
So it looks like this
I like this one a lot less, as it's much harder to reason about.
[1] - in the theme refactor, every organizer has a file like
organizers/firstname-lastname.md
instead of being in a data yaml file, fyiThe text was updated successfully, but these errors were encountered: