HUGO

Alias for Page Resources

Hello!

Is there some mechanism for aliasing page resources? I’m updating a 10 year old site, and want to preserve other people’s links to the site. Aliases for Pages have been great, but I don’t see aliases for Page Resources. A workaround is uploading the files in /static/ with the old URL structure, but it feels a little bad to upload the files twice.

Does anyone have a suggestion? Is anyone else interested enough in this that I should make a feature request?

Thank you! I love Hugo, thanks for everyone building it and those answering questions on the forum.

No there is no such mechanism.

Perhaps you could you use symlinks placed under the old ULR structure in the static folder to point to those Page Resources currently residing in Bundles.

I am not in favor of using symlinks as they can be a nightmare to maintain but in the use case, you described i.e.access to resources from an alternative URL then perhaps they are a viable option.

However also note that -if memory serves me right- Hugo will create a duplicate file under the url of the symlink when the site is published -there is no redirection going on, you would have to do that server side-.