Anyway to allow URLs to have the "@" character

I have a directory full of usernames like this:

/posts/@ john
/posts/@ mary
/posts/@ phil

However, the @ character is removed from generated URLs. Is there any way to allow the @ character in URLs without overwriting the URL for every file in those directories?

I don’t think it is allowed in the allowed characters. Not a hugo pb.

https://www.rfc-editor.org/rfc/rfc1738

I spent some time reading the RFC’s, following the various “superseded by” references.

With the https scheme, while the @ symbol has special meaning before the host portion of the URL, it does not have special meaning in the path.

https://user:password@example.org/@foo
                     ^
              special meaning

For example, Google Maps uses the @ symbol prior to geo coordinates:

https://www.google.com/maps/place/Paris,+France/@48.8588336,2.2769957,...

So it looks like we should allow this without percent encoding.

Although probably limited in scope, this change would break existing link references.

https://github.com/gohugoio/hugo/pull/10549

1 Like

I appreciate you digging into this and getting an MR to fix it so quickly, thank you!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.