refactor: localiser le layout, hreflang, détection langue
This commit is contained in:
@@ -1,37 +1,42 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="fr">
|
<html lang="{{ locale }}">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<!-- Title & Description -->
|
<!-- Title & Description -->
|
||||||
<title>{% if title %}{{ title }} | {{ site.name }}{% else %}{{ site.name }} | {{ site.shortName }}{% endif %}</title>
|
<title>{% if title %}{{ title }} | {{ t.site.name }}{% else %}{{ t.site.name }} | {{ t.site.shortName }}{% endif %}</title>
|
||||||
<meta name="description" content="{{ description or site.description }}">
|
<meta name="description" content="{{ description or t.site.description }}">
|
||||||
<meta name="keywords" content="OKI, ORGANISATION KA INTERNATIONALE, application web sur mesure, associations militantes, développement web, souveraineté numérique, tarifs solidaires, logiciel libre, Guadeloupe, Martinique, Caraïbes, numérique éthique, Castopod, KUTE, hébergement libre, alternative GAFAM">
|
<meta name="keywords" content="{{ t.site.keywords }}">
|
||||||
<meta name="author" content="{{ site.name }}">
|
<meta name="author" content="{{ t.site.name }}">
|
||||||
|
|
||||||
<!-- Canonical URL -->
|
<!-- Canonical URL -->
|
||||||
<link rel="canonical" href="https://o-k-i.net{{ page.url or '/' }}">
|
<link rel="canonical" href="https://o-k-i.net{{ page.url or '/' }}">
|
||||||
|
|
||||||
|
<!-- Alternate languages -->
|
||||||
|
<link rel="alternate" hreflang="fr" href="https://o-k-i.net/">
|
||||||
|
<link rel="alternate" hreflang="en" href="https://o-k-i.net/en/">
|
||||||
|
<link rel="alternate" hreflang="x-default" href="https://o-k-i.net/">
|
||||||
|
|
||||||
<!-- Open Graph / Facebook -->
|
<!-- Open Graph / Facebook -->
|
||||||
<meta property="og:type" content="website">
|
<meta property="og:type" content="website">
|
||||||
<meta property="og:url" content="https://o-k-i.net{{ page.url or '/' }}">
|
<meta property="og:url" content="https://o-k-i.net{{ page.url or '/' }}">
|
||||||
<meta property="og:title" content="{% if title %}{{ title }}{% else %}{{ site.name }} - Prenons le contrôle de notre internet{% endif %}">
|
<meta property="og:title" content="{% if title %}{{ title }}{% else %}{{ t.site.name }} - {{ t.site.og_tagline }}{% endif %}">
|
||||||
<meta property="og:description" content="{{ description or site.description }}">
|
<meta property="og:description" content="{{ description or t.site.description }}">
|
||||||
<meta property="og:image" content="https://o-k-i.net/assets/images/logo-512x512.png">
|
<meta property="og:image" content="https://o-k-i.net/assets/images/logo-512x512.png">
|
||||||
<meta property="og:image:width" content="512">
|
<meta property="og:image:width" content="512">
|
||||||
<meta property="og:image:height" content="512">
|
<meta property="og:image:height" content="512">
|
||||||
<meta property="og:image:alt" content="Logo {{ site.name }}">
|
<meta property="og:image:alt" content="Logo {{ t.site.name }}">
|
||||||
<meta property="og:locale" content="fr_FR">
|
<meta property="og:locale" content="{{ t.site.og_locale }}">
|
||||||
<meta property="og:site_name" content="{{ site.name }}">
|
<meta property="og:site_name" content="{{ t.site.name }}">
|
||||||
|
|
||||||
<!-- Twitter Card -->
|
<!-- Twitter Card -->
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
<meta name="twitter:url" content="https://o-k-i.net{{ page.url or '/' }}">
|
<meta name="twitter:url" content="https://o-k-i.net{{ page.url or '/' }}">
|
||||||
<meta name="twitter:title" content="{% if title %}{{ title }}{% else %}{{ site.name }} - Prenons le contrôle de notre internet{% endif %}">
|
<meta name="twitter:title" content="{% if title %}{{ title }}{% else %}{{ t.site.name }} - {{ t.site.og_tagline }}{% endif %}">
|
||||||
<meta name="twitter:description" content="{{ description or site.description }}">
|
<meta name="twitter:description" content="{{ description or t.site.description }}">
|
||||||
<meta name="twitter:image" content="https://o-k-i.net/assets/images/logo-512x512.png">
|
<meta name="twitter:image" content="https://o-k-i.net/assets/images/logo-512x512.png">
|
||||||
<meta name="twitter:image:alt" content="Logo {{ site.name }}">
|
<meta name="twitter:image:alt" content="Logo {{ t.site.name }}">
|
||||||
|
|
||||||
<!-- Favicons -->
|
<!-- Favicons -->
|
||||||
<link rel="icon" type="image/x-icon" href="/assets/images/favicon.ico">
|
<link rel="icon" type="image/x-icon" href="/assets/images/favicon.ico">
|
||||||
@@ -51,11 +56,11 @@
|
|||||||
{
|
{
|
||||||
"@context": "https://schema.org",
|
"@context": "https://schema.org",
|
||||||
"@type": "Organization",
|
"@type": "Organization",
|
||||||
"name": "{{ site.name }}",
|
"name": "{{ t.site.name }}",
|
||||||
"alternateName": "{{ site.shortName }}",
|
"alternateName": "{{ t.site.shortName }}",
|
||||||
"url": "https://o-k-i.net",
|
"url": "https://o-k-i.net",
|
||||||
"logo": "https://o-k-i.net/assets/images/logo-512x512.png",
|
"logo": "https://o-k-i.net/assets/images/logo-512x512.png",
|
||||||
"description": "{{ site.description }}",
|
"description": "{{ t.site.description }}",
|
||||||
"address": {
|
"address": {
|
||||||
"@type": "PostalAddress",
|
"@type": "PostalAddress",
|
||||||
"streetAddress": "36 Rue Lethière",
|
"streetAddress": "36 Rue Lethière",
|
||||||
@@ -89,7 +94,7 @@
|
|||||||
"sameAs": ["https://djangokam.pawol.nu"],
|
"sameAs": ["https://djangokam.pawol.nu"],
|
||||||
"member": {
|
"member": {
|
||||||
"@type": "Organization",
|
"@type": "Organization",
|
||||||
"name": "{{ site.name }}",
|
"name": "{{ t.site.name }}",
|
||||||
"url": "https://o-k-i.net"
|
"url": "https://o-k-i.net"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -114,6 +119,24 @@
|
|||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
(function() {
|
||||||
|
// Redirection automatique selon la langue du navigateur, sauf choix explicite déjà mémorisé
|
||||||
|
var pref = localStorage.getItem('oki-lang-pref');
|
||||||
|
if (pref) return;
|
||||||
|
|
||||||
|
var browserLang = (navigator.language || navigator.userLanguage || '').toLowerCase();
|
||||||
|
var wantsEnglish = browserLang.indexOf('en') === 0;
|
||||||
|
var currentLocale = '{{ locale }}';
|
||||||
|
|
||||||
|
if (wantsEnglish && currentLocale !== 'en') {
|
||||||
|
window.location.replace('/en/' + window.location.hash);
|
||||||
|
} else if (!wantsEnglish && currentLocale === 'en') {
|
||||||
|
window.location.replace('/' + window.location.hash);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% include "partials/nav.njk" %}
|
{% include "partials/nav.njk" %}
|
||||||
|
|||||||
Reference in New Issue
Block a user