I've been using the slugorfilename permalink token to strip out the first section, like so:
permalinks:
page:
foo: /:sections[1:]/:slugorfilename/
section:
foo: /:sections[1:]/:slugorfilename/
After getting warnings that this is deprecated, and I should use slugorcontentbasename instead, I tried it. But this seems to generate an additional subdirectory for section pages where the slugorfilename did not:
permalinks:
page:
foo: /:sections[1:]/:slugorcontentbasename/
section:
foo: /:sections[1:]/:slugorcontentbasename/
I.e., given content pages like this:
$ tree content/
content/
└── foo
├── _index.md
└── bar
├── _index.md
└── somepage.md
3 directories, 3 files
The html output for content/bar/_index.md is generated at public/bar/bar/html:
$ tree public/
public/
├── bar
│ ├── bar
│ │ └── index.html
│ └── somepage
│ └── index.html
└── foo
└── index.html
5 directories, 3 files
See repro: https://github.com/dvdksn/contentbasename
What version of Hugo are you using (hugo version)?
$ hugo version
v0.152.2
Does this issue reproduce with the latest release?
yes
I've been using the
slugorfilenamepermalink token to strip out the first section, like so:After getting warnings that this is deprecated, and I should use
slugorcontentbasenameinstead, I tried it. But this seems to generate an additional subdirectory for section pages where theslugorfilenamedid not:I.e., given content pages like this:
The html output for
content/bar/_index.mdis generated atpublic/bar/bar/html:See repro: https://github.com/dvdksn/contentbasename
What version of Hugo are you using (
hugo version)?Does this issue reproduce with the latest release?
yes