Skip to content

In "hugo config", don't print empty sub maps #14855

@bep

Description

@bep

E.g.

With old style permalinks config like this:

[permalinks]
    post  = "/:year/:month/:slug/"
    photo = "/:year/:month/:slug/"

Running hugo config, you get (something like, I have truncated it a little) this:

[[permalinks]]
  pattern = '/:year/:month/:slug/'
  [permalinks.target]
    path = '/{photo,photo/**}'

    [permalinks.target.sites]
      [permalinks.target.sites.complements]

      [permalinks.target.sites.matrix]

I would expect/prefer this:

[[permalinks]]
  pattern = '/:year/:month/:slug/'
  [permalinks.target]
    path = '/{photo,photo/**}'

The permalinks.target.sites have a IsZero method that should drop it from the output. Not sure why that don't happens.

Metadata

Metadata

Assignees

Labels

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