Introduce multi-lingual docs
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
10
docs/fr/docs/index.md
Normal file
10
docs/fr/docs/index.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: Documentation de Mobilizon
|
||||
---
|
||||
|
||||
Bienvenue sur la documentation de Mobilizon
|
||||
|
||||
* [En apprendre plus à propos de Mobilizon](/about) (en anglais)
|
||||
* Apprendre comment utiliser Mobilizon (pas encore écrit)
|
||||
* [Apprendre à installer Mobilizon](/administration) (en anglais)
|
||||
* [Apprendre à contribuer à Mobilizon](/contribute) (en anglais)
|
||||
42
docs/fr/mkdocs.yml
Normal file
42
docs/fr/mkdocs.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
site_name: Mobilizon
|
||||
repo_name: "framasoft/mobilizon"
|
||||
repo_url: "https://framagit.org/framasoft/mobilizon"
|
||||
site_dir: "../../site/fr"
|
||||
extra:
|
||||
social:
|
||||
- icon: "fontawesome/brands/twitter"
|
||||
link: "https://twitter.com/joinmobilizon"
|
||||
markdown_extensions:
|
||||
- admonition
|
||||
- codehilite
|
||||
- footnotes
|
||||
- meta
|
||||
- toc:
|
||||
permalink: true
|
||||
- pymdownx.superfences
|
||||
- pymdownx.magiclink
|
||||
- pymdownx.smartsymbols
|
||||
- pymdownx.tabbed
|
||||
- pymdownx.tilde
|
||||
- pymdownx.mark
|
||||
plugins:
|
||||
- search:
|
||||
lang: ["fr"]
|
||||
- git-revision-date-localized
|
||||
- minify:
|
||||
minify_html: true
|
||||
theme:
|
||||
name: "material"
|
||||
language: "fr"
|
||||
features:
|
||||
- instant
|
||||
- tabs
|
||||
custom_dir: "../theme/"
|
||||
palette:
|
||||
primary: "amber"
|
||||
accent: "deep purple"
|
||||
scheme: slate
|
||||
font: false
|
||||
icon:
|
||||
logo: material/calendar
|
||||
repo: fontawesome/brands/gitlab
|
||||
18
docs/javascripts/redirect.js
Normal file
18
docs/javascripts/redirect.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const languages = ["fr"];
|
||||
|
||||
const navigatorLanguage =
|
||||
window.navigator.userLanguage || window.navigator.language;
|
||||
|
||||
let language;
|
||||
if (languages.includes(navigatorLanguage)) {
|
||||
language = navigatorLanguage;
|
||||
}
|
||||
const split = navigatorLanguage.split("-")[0];
|
||||
if (languages.includes(split)) {
|
||||
language = split;
|
||||
}
|
||||
const url = new URL(window.location.href);
|
||||
if (language && (url.pathname === "/" || url.pathname.startsWith("/use/"))) {
|
||||
url.pathname = `/${language}${url.pathname}`;
|
||||
window.location.replace(url);
|
||||
}
|
||||
7
docs/theme/main.html
vendored
Normal file
7
docs/theme/main.html
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block site_meta %}
|
||||
{% if page.is_homepage %}
|
||||
<link rel="alternate" hreflang="fr" href="{{ config.site_url }}fr/" />
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user