I have the following URL generated via Hugo:
https://www.snoogans.co.uk/stuff/captive/captive.htm
All other posts use pretty URL’s, so I have not set “uglyURLs: true”.
It is only this one URL that requires this specific URL format/file extension.
For historical reasons, the requirement is to ensure the URL and image/file paths do not change. I don’t want to add any redirects.
The file config is as follows:
File:
content/posts/captive/index.md
Front matter:
---
title: "Captive"
url: /stuff/captive/captive.htm
type: posts
date: 2022-10-30T11:22:00+00:00
description: Archive of various tips and tricks for the "Captive" computer game. Design, programming and graphics by Antony Crowther. Published by Mindscape in 1990.
menu:
sidebar:
name: Captive
weight: 1
hero: images/captive.gif
sitemap:
priority: 0.7
changeFreq: weekly
---
In Hugo versions v0.122.0 and below, this would generate the desired result, as seen in the current live site and here:
https://github.com/eishundo/site-www.snoogans.co.uk/tree/gh-pages/stuff/captive
That is:
/stuff/captive/files/
/stuff/captive/images/
/stuff/captive/jscript/
/stuff/captive/captive.htm
However, in versions higher than v0.122.0, it creates the following directory structure (additional “captive” subdir is created containing the images/files/jscript directories, but not the captive.htm file):
/stuff/captive/captive/files/
/stuff/captive/captive/images/
/stuff/captive/captive/jscript/
/stuff/captive/captive.htm
This means all the links required for images/files/jscript are different which is not desired.
I can almost solve this by leaving the front matter as-is, but moving the file to:
content/stuff/captive/captive.md
However, the hero image can no longer be found and it instead falls back to the default/stock hero image instead of:
---
hero: images/captive.gif
---
Currently testing via:
$ hugo env
hugo v0.123.7+extended linux/amd64 BuildDate=unknown
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.22.0"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.3.2"
Thanks in advance,
eishundo