]> git.maquefel.me Git - brevno-suite/hugo/commit
resources/page: Fix slugorcontentbasename for section pages
authorDavid Karlsson <35727626+dvdksn@users.noreply.github.com>
Mon, 10 Nov 2025 08:33:15 +0000 (09:33 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 10 Nov 2025 16:03:26 +0000 (17:03 +0100)
commit25c7c18f9f8862f756835d3ac3faa4f114c344f6
tree1ff6de1c8600781c6494ca8a2d384712e9965a58
parent0e8f88fa729b1ce795c62466afa8eecd0c329eb9
resources/page: Fix slugorcontentbasename for section pages

The slugorcontentbasename permalink token was creating an extra
subdirectory for section pages (_index.md files). This was because
pageToPermalinkContentBaseName did not have the same special handling
for _index.md files as pageToPermalinkFilename.

This commit adds the special handling to return an empty string for
section pages, ensuring backward compatibility with slugorfilename.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fixes #14104
resources/page/permalinks.go
resources/page/permalinks_integration_test.go