frjo / hugo-theme-zen

A fast and clean Hugo base theme with css-grid and Hugo pipes support.
https://zen-demo.xdeb.org/
GNU General Public License v2.0
264 stars 75 forks source link

Add a shortcode to create an HTML sitemap #92

Closed danielfdickinson closed 1 year ago

danielfdickinson commented 1 year ago

Includes helper templates needed by the shortcode.

This (at the very least) needs documentation added, and likely you will want changes, if it is of interest. It is a copy of what I have in my fork.

frjo commented 1 year ago

I do not think I have created a HTML sitemap in 15, or even 20 years.

What purpose do they fulfil nowadays?

frjo commented 1 year ago

The code is quite complicated and it feels like a nice feature. Maybe you should release it as a component? Then it can be added to any theme.

danielfdickinson commented 1 year ago

The code is quite complicated and it feels like a nice feature. Maybe you should release it as a component? Then it can be added to any theme.

Sound reasonable. I'll do that. I'll close this PR and post a message on the Hugo forum when I've created the component.

I do not think I have created a HTML sitemap in 15, or even 20 years. What purpose do they fulfil nowadays?

This is a 'scratch my own itch' feature. An HTML sitemap allows me to get a sense of where things are on a site, as well as to find pages I would otherwise miss. Also, search is good if you know exactly what you are looking for and use the right keywords, but sometimes I am not being successful at coming up with the right query, but a sitemap gets me where I want to go.

danielfdickinson commented 1 year ago

Hi. I don't use this theme yet (but I intend to), but I tried your shortcode on my site and it only returns posts from one section that uses weight (not date) to group posts. The other sections that use date are omitted.

Thank you for checking it out. I didn't notice this issue because on my site I set a default weight for all pages of about 10000 via a cascade. (I do that because I find adding weights when there is not a default weight results in a sorting order I don't like).

As mentioned, I will post on the Hugo forum when I make this a component.