Generate permalinks by numeric index of post

Many different webcomics use the index of the comic to link items, which makes it much easier to jump around, and tell where you are in the comic. Some notable examples include XKCD and Homestuck.

HUGO is almost ideal for posting a classic-web style webcomic, but it’s missing this bit of key functionality. How would people feel about adding the ability to create posts based on the index of the post?

I think that what makes the most sense is for the index to be generated by getting the dates of all the pages in a content subfolder, then numbering them starting at the oldest from 0.

short try :wink:

automatic renumbering can create different urls after adding or removing pages

You can define a slug in frontmatter and use it with permalink definition for this section


It’s a good idea, but in my head you would end up with unstable URLs in many situations (e.g. multiple posts on the same date without time, adding another post with a date set in the past).

As @juh2 says, using the slug would work (set slug to 0, 1,2), and for small data sets (which I guess a comic would be), remembering the last ID should not be too hard.

Also you could consider paginating your comics (which would give you numbered pages).

Yeah, that’s definitely the trade off. I think that it’s a feature that would definitely not be used for most sites (in fact for many, such as blogs and the like, it would be very bad,) but for other types of static sites, the numbering makes a lot of sense. And while they can be a small dataset, some webcomics are a bit longer, and in the event that someone wants to run a longer comic, it would be a bit tedious to set the number for every panel.

What you also could do would name your content files etc., and then use :filename in the permalinks config.