CorrelAid / correlaid_website

Source code for the CorrelAid website
https://correlaid.org
3 stars 0 forks source link

lowercase citynames in URLs #380

Closed friep closed 11 months ago

friep commented 11 months ago

https://correlaid.org/community/correlaidx/berlin is not found, only https://correlaid.org/community/correlaidx/Berlin . for the sake of consistency and easier writing, i think we should lowercase the names in the urls.

KonradUdoHannes commented 11 months ago

Generally this comes from the city attribute in directus, so I think there are two options.

  1. Change the city attribute in directus to be lowercase
  2. Explicitly do he conversions as part of the websites business logic, i.e. convert cities to lowercase when creating the hyperlinks and convert them back when retrieving the slug and looking up the corresponding chapter in directus.

The second approach would also allow us to be a little more lenient when processing slugs. We could for instance allow both "Berlin" and "berlin" (or even BERLIN etc.) although this would only become relevant if the user types the city manually instead of using the links.

friep commented 11 months ago

i'd prefer 2. because i think 1. could potentially have unexpected side effects (e.g. when we need the city name in other parts of the site)

KonradUdoHannes commented 11 months ago

Agreed, lets do 2. In the end the capitalized versions are the proper names after all, so it makes sense that the CMS stores these. Any name mangling is essentially business logic on and should go into the code.

KonradUdoHannes commented 11 months ago

I deployed the general feature that the lc city names etc. are lowercase in the url, and the internal

Currently the static page does not feature routes that are differently capitalized, i.e. Berlin or BERLIN instead of berlin. The preview site already features a little bit of this logic, but this does not transfer directly to the static build. Do we also want multiple capitalization options as a feature. If so, I see three options for this.

  1. forward in vercel (has the disadvantage of being vercel specific)
  2. forward in our service worker (has the disadvantage of making the service worker more complex)
  3. build the same static page under several routes (has the disadvantage of using up a bit of redundant disk space because duplicates of the pages would be stored for each route)
friep commented 11 months ago

I think all lower case would be sufficient for Isabel and me. this is how it is now on production right? then we can close this issue.