jamulussoftware / jamuluswebsite

This is the GitHub Pages repository for the Jamulus main website. For the jamulus application source code, please visit jamulussoftware/jamulus.
https://jamulus.io
GNU Lesser General Public License v2.1
15 stars 83 forks source link

Identify canonical and alternate URLs #1026

Closed gilgongo closed 2 months ago

gilgongo commented 3 months ago

(The Google docs on this are confusing because they also address things that don't apply to us, so I hope I have the following right!)

Short description of changes

We regard the English version of a page as always being the canonical version. So no other languages should be marked as canonical URLs to content that also exits in English. Alternate URLs are other language versions of the English content.

Context

This should fix an issue which (I think!) Google has when one or more URLs have similar content. For example, if https://jamulus/[lang]/wiki/Installation-for-Linux is partially translated, we need to tell Google that it should regard https://jamulus/wiki/Installation-for-Linux as the canonical version. NOTE: It's possible that this problem was a symptom of us not having correct hreflang codes, but using these rel tags seems to be best practice in our case.

Removed a "rel=canonical" tag from the index pages because we should not put that outside of the HTML head.

Also removed the x-default-hreflang, as we don't have a language-switching page.

Does this need translation?

May need to update the language index pages? Otherwise no?

Checklist

gilgongo commented 3 months ago

@ignotus666 Just checking: nothing in the po4a scripts is affected by this, I take it?

ignotus666 commented 3 months ago

No, I shouldn't think so - if you can build and view the website offline and it works, then the po4a stuff should be fine.

ann0see commented 2 months ago

Thanks

gilgongo commented 2 months ago

Are we OK to merge?

pljones commented 2 months ago

I don't think it's right...

https://github.com/jamulussoftware/jamuluswebsite/actions/runs/10696055730 http://jamuluswebsite.drealm.info/wiki/Installation-for-Linux

<!DOCTYPE html>
<!--[if IE 9]>
<html class="ie9">
<![endif]-->
<html lang="en">
<head>
<title>Installation for Linux – Jamulus Website</title>
<meta charset="utf-8">
<link rel="canonical" hreflang="en" href="/wiki/Installation-for-Linux">
<link rel="alternate" hreflang="sv-SE" href="/sv-SE/wiki/Installation-for-Linux">
...

http://jamuluswebsite.drealm.info/sv-SE/wiki/Installation-for-Linux

<!DOCTYPE html>
<!--[if IE 9]>
<html class="ie9">
<![endif]-->
<html lang="sv-SE">
<head>
<title>Installation för Linux – Jamulus websida</title>
<meta charset="utf-8">
<link rel="canonical" hreflang="en" href="/sv-SE/wiki/Installation-for-Linux">
<link rel="alternate" hreflang="sv-SE" href="/sv-SE/wiki/Installation-for-Linux">
...
  1. If ie9, we get two html tags, which cannot be right. Does IE 9 still exist? Is the XML comment actually parsed?
  2. The http://jamuluswebsite.drealm.info/sv-SE/wiki/Installation-for-Linux page says canonical is en, okay but gives the wrong href to get there.

I should have spotted that earlier, sorry!

ann0see commented 2 months ago

I think we can get rid of IE compatibility. Nobody should be using it anymore now.