Skip to content

Conversation

@AlexanderZhirov
Copy link

Adjusted the parameter for displaying recent posts on the home page. Considering that we can create multiple sections, it makes more sense to use their list.

In this case, we create an array where we specify the list of sections from which we can display our posts.

@tomfran
Copy link
Owner

tomfran commented Apr 19, 2025

Can you please include an example of the result?
Also, this will break current configs, I would add something like homeCollectionList parameter, which, if populated, overrides the current homeCollection.

@AlexanderZhirov
Copy link
Author

Won't an additional parameter for the same entity be excessive? I think it complicates the configuration by having two parameters. If we have a single parameter as a list, we can simply modify it, and if nothing is added, then nothing is displayed.

@AlexanderZhirov
Copy link
Author

Though you're right—backward compatibility breaks existing configurations. We might have to add an extra parameter after all. I'll adjust my changes.

@tomfran
Copy link
Owner

tomfran commented Apr 20, 2025

I agree that it would be better a single parameter, but I feel this would break a lot of configs.

Do you know maybe if there's a way to make both a list and a single string work together? Maybe something like:

if is instance list: render list
else: render as is

@tomfran
Copy link
Owner

tomfran commented Apr 24, 2025

Thank you for the update, I was thinking of something tho. Since this setup does not allow to have a title for each collection, the result could look a bit off, for instance, I would expect something like:

# Collection title
- ...
- ...
- ...

# Second collection title
- ...
- ...
- ...

So, since we are breaking the config anyway, what would you say in adding something along those lines:

hugo.toml

[[params.home_collections]]
title = 'First Collection'
collection = "first"

[[params.home_collections]]
title = 'Second Collection'
collection = "second"

We could treat the current homeCollectionTitle and homeCollectionTitle as is, and simply render in the same way elements from those params (as we do for social icons and the menu). We don't break compatibility, and I will simply remove the existing params from the suggested config on the Wiki.

I know this requires more work, but it would be way nicer I feel, what do you think? Sorry for not thinking about this from the start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants