projectblacklight / arclight

A Rails engine supporting discovery of archival material
https://samvera.atlassian.net/wiki/spaces/samvera/pages/405211890/ArcLight
Other
39 stars 26 forks source link

Component URLs should separate the ead & ref slugs #1318

Closed seanaery closed 11 months ago

seanaery commented 2 years ago

Summary

ArcLight currently creates URLs to individual components like this: {host}/catalog/{ead_ssi}{ref_ssi}

So we get URLs like: Collection: archives.institution.edu/catalog/slug <-- this is OK Component: archives.institution.edu/catalog/slugaspace_123 <-- this is not ideal

Desired Change

This ticket is a request to improve the component URLs by using one of these conventions instead: archives.institution.edu/catalog/slug/aspace_123 archives.institution.edu/catalog/slug_aspace_123

Reasons for concern over the smooshed together URL

Current ArcLight Usage

No separation in Component URL

These apps follow default core:

Has separation in Component URLs by wedging an underscore between the ead & ref slugs

These apps wedge an underscore between the ead & ref slugs (overriding core):

Other Considerations

@gwiedeman & @jrochkind astutely note on code4lib#arclight Slack that if a change is made to core, it's important to be able to redirect from the old style to keep existing URLs working. And even if core stays how it is, I recommend making the convention configurable or otherwise straightforward to override globally.

cbeer commented 2 years ago

https://github.com/projectblacklight/arclight/pull/1317 is an idea for a seam for downstream applications to decide what style they want 🤷‍♂️

jrochkind commented 2 years ago

Harms SEO, i.e., makes it harder to Google using the EAD slug

It's a bit of an esoteric art and I'm not necessarily an expert, but I believe that /slug/aspace_123 will be a lot more reliable than /slug_aspace_123 with regard to that.

Can make web analytics reports on per-collection activity harder to parse

Depending on the tool you're using, I think same.

If you're going to do the work to make a change (globally or with a "seam" in an individual app), I predict you'll be a lot happier over the long-term, and less likely to need to change it again, if you can go to /. Even if might require messing with Rails routing a bit more.

seanaery commented 11 months ago

@marlo-longley We are definitely still interested in prioritizing this work. In lieu of having a configurable way to do this, here's what we ended up having to modify in our local 1.0.1-based app:

marlo-longley commented 11 months ago

Thank you @seanaery. In earlier comments it seemed like some people had a strong preference for splitting the URL into a new path instead of the underscore separation (so that'd be /slug/aspace_123 rather than /slug_aspace_123) -- that's mainly what I wanted to make sure to consider before moving on a solution.

Your code is really helpful and seems much for straightforward in terms of routing to achieve. I will try to work something with this approach.

gwiedeman commented 11 months ago

We would want to continue the current URLs in our local instance just for persistence, but I the default should probably be the slash (archives.institution.edu/catalog/slug/aspace_123). I think that is okay if its config that you could just change in catalog_controller or similar and its clearly stated in the release notes how to maintain older-style URLs.