Closed seanaery closed 11 months ago
https://github.com/projectblacklight/arclight/pull/1317 is an idea for a seam for downstream applications to decide what style they want 🤷♂️
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.
@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:
to_field 'id'
from ead2_component_config.rb
to join the two parts with an underscore (commit). This takes care of most of the logic for a component URL, tbh, and wasn't too heavy a lift, but...app/models/arclight/parent.rb
which includes a method global_id
that assumes the component ID is "#{eadid}#{id}"
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.
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.
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 idealDesired 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
ead
slugs often end in letters andref
values often begin withal
oraspace
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
slugsThese 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.