I'm using https://surge.sh/ to deploy my hugo site. It has a great clean url feature, so if you have /foo.html, /foo will get it, /foo/ will redirect to /foo.
So now I'm creating content/foo.md, and enabling uglyurls so hugo generates /foo.html.
In some pages, such as listing page, I'm now using {{ trim .RelPermalink ".html" }} to use clean url in href. However, this causes problem with hugo server. A request of /foo doesn't check the existence of /foo.html, but directs to /foo/ to try /foo/index.html immediately.
I'm using https://surge.sh/ to deploy my hugo site. It has a great clean url feature, so if you have
/foo.html,/foowill get it,/foo/will redirect to/foo.So now I'm creating
content/foo.md, and enablinguglyurlsso hugo generates/foo.html.In some pages, such as listing page, I'm now using
{{ trim .RelPermalink ".html" }}to use clean url in href. However, this causes problem with hugo server. A request of/foodoesn't check the existence of/foo.html, but directs to/foo/to try/foo/index.htmlimmediately.