Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Aliases of pages (defined in front matter) of a headless section are rendered #14807

@irkode

Description

@irkode

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>
    

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions