I copied a URL from my browser and pasted it into Slack, only to discover it wasn't working:
https://foundation.mofostaging.net/en/privacynotincluded/categories/Valentine%E2%80%99s%20Day/
The correct link is
https://foundation.mofostaging.net/en/privacynotincluded/categories/Valentine's%20Day/
The trick here is that somewhere along the way, the apostrophe got converted into a "smart apostrophe" (That's probably the wrong word. It's the curly kind.)
Given that this is going to start being shared narrowly tomorrow and broadly in the following few days, what's the best thing we can do to make sure we don't have users stumbling on this and getting 404's? Can we easily sanitize the string that generates the category URL to strip that character altogether (thus making the url /categories/Valentines%20Day)? Or should we simply catch it with a redirect in the CMS admin for now?
@patjouk @cadecairos @Pomax @mmmavis
Remember that this isn't technically Wagtail-managed at all, it's a plain Django app, so we're currently beholden to whatever Django does. We're creating the actual link over in https://github.com/mozilla/foundation.mozilla.org/blob/master/network-api/networkapi/buyersguide/templates/category_nav_links.html#L5-L6, so one thing we can probably do here is use a sluggifying tag to make the url itself look normal, with an unsluggifier on the views.py side to make sure that the right category gets served up.
If categories are a model, we can do something similar to how we slugify product names: https://github.com/mozilla/foundation.mozilla.org/blob/7aa8d2b590330306341758d7ed5cf36de3ca7aaa/network-api/networkapi/buyersguide/models.py#L485-L487
Yeah, I just added that.