open-contracting / data-registry

BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Pretty URLs #133

Open jpmckinney opened 3 years ago

jpmckinney commented 3 years ago

e.g. /publication/canada-buy-and-sell instead of /publication/123

We should probably add a "slug" field to manually enter, since some publication names are very long, and to avoid breaking URLs if we edit the publication name.

If done after launch, we can set up redirects.

We should also add <link rel="canonical" href="{{ request.path }}"> at this point (the current URLs are not canonical).

Noting that we don't need the <link> to distinguish from the old URL, because the old URL becoming a redirect is sufficient.

yolile commented 2 years ago

Maybe we can add the field and initially populate it (via a query in the database) with the kingfisher collect spider name? (replacing "_" with "-" and removing "_api", "_bulk", "_records", "_releases")

jpmckinney commented 2 years ago

Yes. The migration file can perhaps do the prepopulating.