roman-gardens / gre

Gardens of the Roman Empire
http://roman-gardens.github.io/
8 stars 20 forks source link

stable ids for gardens #208

Open kgjenkins opened 3 years ago

kgjenkins commented 3 years ago

Consider adding an opaque id to the front matter of each garden, and see if there is a way to keep the place hierarchy in the directory structure (and even the file names), but the public URLs would use the gre_id for a shorter, more stable URL that would act as a permalink for citation, and would look something like:

instead of:

Potential benefits:

Potential implementation:

kgjenkins commented 3 years ago

One complication would be links between gardens. Right now, it is easy to link to other gardens in the same directory, since Atom makes it easy to see those filenames. Using ids might make that harder.

If this proposal ends up not being possible, a fallback would be to publish an id-based permalink on each garden page, and set up Hugo to run a redirect from the permalink (.../garden/12345) to the filename-based URL (.../province/judaea/caesarea_maritima/byzantine_law_court_and_roof_garden/).

kgjenkins commented 3 years ago

Christian made the great suggestion that we could hash the URL to get a unique ID. If the script only adds such article IDs when they don't already exist, then there shouldn't be any problem moving or renaming a file.

kgjenkins commented 3 years ago

I have a garden-ids branch that does the following:

And, finally, the main reason for doing all of this...

I currently have this branch published to the test website..

Here is the full URL of a garden: https://roman-gardens.github.io/gre-website-test/province/africa_proconsularis/pupput/house_of_the_black_and_white_triclinium/

And here is the permalink: https://roman-gardens.github.io/gre-website-test/id/b758b14e74

On the public site, these URLs will be even shorter (although this one doesn't work yet until we publish to the public website): https://roman-gardens.github.io/id/b758b14e74

kgjenkins commented 3 years ago

p.s. I didn't use the Hugo permalink feature for this, because it broke relative links to images, etc. Using Hugo aliases that redirect to the full URL works much more smoothly.

kgjenkins commented 3 years ago

And if we like this, we'll want to

kgjenkins commented 2 years ago

I've re-published the garden-ids to the test website, so the links above should work again.