-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Description
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 filesThe 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 filesSee 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