razonyang / hugo-theme-bootstrap

A fast, responsive, multipurpose and feature-rich Hugo theme.
https://hbs.razonyang.com
MIT License
507 stars 166 forks source link

Please sort taxonomy #512

Closed Natenom closed 2 years ago

Natenom commented 2 years ago

Is your feature request related to a problem? Please describe. Tags/Categories in Posts are not sorted.

Mobilität Autos Falschparken Feuerwehr Perouse OpenBikeSensor FahrradInfrastruktur

Describe the solution you'd like Should be:

Autos Falschparken FahrradInfrastruktur Feuerwehr Mobilität OpenBikeSensor Perouse

Tried to achieve that with sort in post/meta.html but it didn't work.

chrisrummel commented 2 years ago

Is it always sorted by title now? I quite liked that it was ordered by the most used taxonomy down to taxonomies that have only been used once. If possible, I would like that to be configurapble by a param taxonomySortOrder.

razonyang commented 2 years ago

Is it always sorted by title now? I quite liked that it was ordered by the most used taxonomy down to taxonomies that have only been used once. If possible, I would like that to be configurapble by a param taxonomySortOrder.

Sounds better, reopen it.

Natenom commented 2 years ago

Now there is another problem. There is no seperation between categories and tags. So now the tags are somewhere in between the tags.

razonyang commented 2 years ago

Are you mean sorting the items in their taxonomy's scope instead of all taxonomies?

Natenom commented 2 years ago

Jupp :)

CategoryA, CategoryB, TagA, TagB, ... :)

razonyang commented 2 years ago

@Natenom @chrisrummel I created the taxonomySortingMethod parameter. The taxonomies are sorting in alphabetical order by default, you can sort taxonomies by their popularity setting taxonomySortingMethod="popularity". It sorts the taxonomies in taxonomy's pages(such as /tags, /categories) and the post's meta. The taxonomies on the sidebar always be sorted in popularity order.

chrisrummel commented 2 years ago

@razonyang Thanks, that works nicely. I just pulled all the latest changes and I really like the alphabetical order under /tags while still having popularity order in the sidebar.

I am getting a WARNING: calling IsSet with unsupported type "bool" (bool) will always return false. while building, though.

razonyang commented 2 years ago

I am getting a WARNING: calling IsSet with unsupported type "bool" (bool) will always return false. while building, though.

That is a known warning message about fullWidth parameter, it won't bring any errors.