-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slashes in a taxonomy term break path resolution #4090
Comments
I assume you know that you can have content files with proper titles for your terms? So "Retro-Grade" (term) can easily have a title with slashes or whatever. |
I hadn't considered that option, and it does provide a workaround for me; which won't be terribly difficult to maintain, given how few titles have this problem. Thanks for the suggestion! It's still a bit non-ideal, since my content will have to remember to use "Retro-Grade" to reference the game "Retro/Grade" Following the discussion on #4092 , and given that I no longer need a template function for "segment" versus full-path sanitization; would you agree with the longer-term goal of cleaning up how Hugo joins paths together? (To ensure that paths made of "partOne" "part/Two" "partThree" doesn't include a spurious slash in the second part.) |
On further testing, this workaround actually isn't sufficient for my use-case.
|
Add tests with slashes in terms to illuminate failing code paths. Updates gohugoio#4090
MakePathSegment properly sanitizes path segments (like taxonomy terms) with slashes (and pound signs). Updates gohugoio#4090
This commit attempts to sanitize term keys and path segments to fix the handling of taxonomy terms containing slashes. Based upon gohugoio#4092 by @tsuereth. Fixes gohugoio#4090
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. |
Add tests with slashes in terms to illuminate failing code paths. Updates gohugoio#4090
MakePathSegment properly sanitizes path segments (like taxonomy terms) with slashes (and pound signs). Updates gohugoio#4090
This commit attempts to sanitize term keys and path segments to fix the handling of taxonomy terms containing slashes. Based upon gohugoio#4092 by @tsuereth. Fixes gohugoio#4090
@moorereason are you sure? That was not the intention, and there were'nt any existing breaking tests ... |
Then I'm mistaken. Thanks for setting me straight. 👍 |
Closing. The
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
My blog is about video games. So for the taxonomy "games" I have terms such as:
When these taxonomy terms are translated into url-safe slugs, the slashes are left untouched. As a result, the website path to the page for SHENZHEN I/O would be something like
/games/shenzhen-i/o/
This subsequently breaks the mapping of path "sections" to meaningful information. When hugo renders content for
games/shenzhen-i/o
it breaks the path into the sections "games" (the parent taxonomy), then "shenzhen-i" (the taxonomy term), then "o" (which is discarded?).So when a content template looks for pages tagged with the matching taxonomy term, it ends up looking for "SHENZHEN I" -- which doesn't match my posts for "SHENZHEN I/O"
The text was updated successfully, but these errors were encountered: