What I am seeking to do is create two permalinks for the same post, one organized by date, the other with a title - like so:
'/:year/:month/:day'
'/:year/:month/:slug'
Creating, essentially, a human memorizable shortlink, and one better for computers - to be specific, this would allow me to setup permashortlinks trivially.
I understand I can manually create a suitable alias inside the post file, but I would like hugo to create the alias automatically for all posts.
Using 2 links (just as a links) to that same article is bad for SEO.
Google and others will penalize you for Duplicated Content.
To do this correctly, one link shall be set as canonical.
The best is to do a 301 redirects but you can also use the Hugo aliases feature.
---
url:
aliases:
---
— back to your question —
Re to '/:year/:month/:day' just create a folder structure in YYYY/MM/DD and that’s will be sorted by default unless url specified. Then do alias manually or specify archetype for that do this automatically based on filename if you will be using hugo new to add post.
For example this:
title: "{{ replace .Name "-" " " | title }}"
Will create title automatically prefilled based on markdown filename (that may be your slug)
Next, just sort the year and date automatic generation.
The default [permalinks] configuration would be something like:
shortener = "/:random[7:10]/"
[7:10] = minimum to maximum characters
:random = [a-zA-Z][0-9]
Would need some collision check though.
Or, you can do something like:
shortener = "/:shortslug-:random[2:5]/"
:shortslug = frontmatter param like slug but only used to give more control to your shortURLs
Together, it will lessen collisions too.
In any case, yeah, currently I’m not so sure there’s an easy way to integrate short URLs into Hugo without actually using a hosted script which generates and stores the generated shortened URLs in some database.