programminghistorian / jekyll

Jekyll-based static site for The Programming Historian
http://programminghistorian.org
521 stars 229 forks source link

move English pages to /en directory #826

Closed acrymble closed 6 years ago

acrymble commented 6 years ago

As we're getting ready for a third language, does it make sense to shift all English pages to an /en directory in the same fashion as /es or /fr? This obviously means building in redirects and updating links. But it would mean ending the assumption that English is the default or most important language.

@mdlincoln you are the one who knows how complex this would be, so I'll defer to you.

mdlincoln commented 6 years ago

This is a very important question that I'd been thinking about during the recent language refactoring work. I agree completely that structuring every language within a sub-directory would be an important way to underline that the journal is language independent, and doesn't structurally privilege English.

On the technical side of things, this does mean a fair amount of work, though not necessarily prohibitive. All existing English pages would need to be given redirect_from tags so that their old links remain valid; many of the snippets links would need to be revised; we'd also need to very carefully plan which pages would still be available at the root domain (index? the rss feeds? what about the blog?) The validation plugin script would also need to be revised, as would the defaults set in _config.yml.

For the next month or two my bandwidth is going to be quite limited, so if someone would like to take a crack at this, I am very happy to review their work. However, I won't be able to take it on entirely myself right now.

drjwbaker commented 6 years ago

This sounds like it needs a team and a clear plan. Can we acknowledge at this stage that we want to do this in order to not privilege English, but accept that we need capacity to do it which we don't have right now?

acrymble commented 6 years ago

Part of that process might need to include separating the English editorial "Managing Editor" from a language neutral first point of contact for queries about the whole project (such as wanting to add a new sub team). At the minute this is bundled inherently in the English language representative.

acrymble commented 6 years ago

I've started working on this on a new branch: https://github.com/programminghistorian/jekyll/tree/issue-826

Just to help this along. Here is a list of the pages that would have to be moved:

/lessons


These pages also seem to have things related to language and the URL:

drjwbaker commented 6 years ago

I think we need a list of all the activities that need to happen to deAnglicise our infrastructure (tech and social), give them separate tickets, divide up the work.

So alongside this, I can think of:

Anyone, I think this needs to go on a fresh ticket (I'm just keen not to do open yet another ticket if we can help it..)

mdlincoln commented 6 years ago

a list of pages that should be translated consistently between EN/ES/FR

@acrymble already did this: https://github.com/programminghistorian/jekyll/wiki/Additional-Language-Sub-Teams-Policy (also as https://programminghistorian.org/translation-concordance notes, that is a page of actually-translated pages, not should-be-translated pages.

drjwbaker commented 6 years ago

@mdlincoln My bad. Forgive me :)

acrymble commented 6 years ago

is there someone on the English editorial team that would be willing to work on some of these matters?

mdlincoln commented 6 years ago

One correction, Adam - given the way our architecture works, both images and assets must stay exactly where they are. Many (like lesson avatars or our team member profile pics) are referenced across lessons.

mdlincoln commented 6 years ago

@acrymble I notice you are repeating a lot of commits to add the issue urls back on to lessons. This work is done and now merged onto the gh-pages branch, so you shouldn't re-do it, otherwise there will be a huge number of merge conflicts.

acrymble commented 6 years ago

@mdlincoln ya I had made the mistake of updating files that were being updated elsewhere, so I had changed internal links to /en/lessons/..

It seemed faster to add in the review-ticket metadata for the entries I'd already done than to go through looking for links to change, which takes longer.

mdlincoln commented 6 years ago

OK, I think we erred in not setting down a general strategy for this move. It's important to fully sketch out necessary changes, and to rule out unnecessary changes. I'm sorry for not doing that.

  1. I'd restart this work by creating a new branch off of the current gh-pages, which contains all the changes to lesson metadata from the review ticket PR.
  2. I strongly suggest moving entire directories by doing this work on your local computer using GitHub Desktop, rather than trying to use the GitHub web interface. This way, you won't need to move each lesson individually. This will vastly simplify the commit history and make it easier for me to review.
  3. We should not be manually updating existing internal links to point to new URLs. Rather, we need to be adding redirect_from to every page being moved. That's the only metadata that ought to be changing right now. That means we won't need to update e.g. any hardcoded links when one lesson refers to another - the redirects will handle that work for us.
acrymble commented 6 years ago

Ok. Does the redirect_from just go in the yml of the file that's moved? I'm not totally clear how the server finds it. Is there a master redirects file somewhere that acts like a map?

mdlincoln commented 6 years ago

No central action is needed. You just add a field in the YAML metadata like so:

redirect_from: /lessons/getting-started-with-mysql-using-r

It should contain the path of the old location of the lesson, no https://programminghistorian.org required.

acrymble commented 6 years ago

Ok, I've done this ,but it's on my desktop computer. So I just have to figure out how to do a pull request.

acrymble commented 6 years ago

Tihs was merged with #846. Other than the /index.md, everything should now be moved. Hopefully nothing broken.

drjwbaker commented 6 years ago

I clicked around for a few minutes and nothing broken that I've noticed. Only thing I did notice was slight hang/redirect when going into EN menu items

acrymble commented 6 years ago

Thanks James. I noted that too. I think we should change the menu items to directly point to the new pages. There's really no need to have redirecting.

drjwbaker commented 6 years ago

Want me to do anything?

acrymble commented 6 years ago

Would be awesome if you could do a pull request just updating the menu links (the redirects on the actual pages should still work I think).

drjwbaker commented 6 years ago

Nope. No idea how to do this. Presume we are looking to change https://github.com/programminghistorian/jekyll/blob/gh-pages/_includes/menu.html ?

mdlincoln commented 6 years ago

@drjwbaker look in the _data/snippets.yml file, you'll see all the menu labels and links there

drjwbaker commented 6 years ago

Thanks @mdlincoln. PR ready.