Aliases should not be created for pages that are not rendered.
also happens if you mount an external module to your own headless section.
versions checked
- Looks like a regression with v0.155.0
- still there in v0.160.1
- v0.154.5 does not create the aliases
steps to reproduce:
-
create a section posts with a page
-
add an alias in front matter: aliases = '/posts/foo'
-
hugo will create the page and the alias foo which redirects to page
└───posts
│ index.html
├───foo
│ index.html
└───post-1
index.html
-
turn the posts section to headless
[[cascade]]
[cascade.build]
list = 'local'
publishResources = false
render = 'never'
-
hugo will still create the alias page
└───posts
└───foo
index.html
which is just an empty page
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=">
</head>
</html>
Aliases should not be created for pages that are not rendered.
also happens if you mount an external module to your own headless section.
versions checked
steps to reproduce:
create a section
postswith a pageadd an alias in front matter:
aliases = '/posts/foo'hugo will create the page and the alias foo which redirects to page
turn the
postssection to headlesshugo will still create the alias page
which is just an empty page