feat: support multilingual sites
This commit is contained in:
@ -44,6 +44,20 @@ body {
|
|||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#lang {
|
||||||
|
position: absolute;
|
||||||
|
top: 1%;
|
||||||
|
right: 1%;
|
||||||
|
margin: 0.5em;
|
||||||
|
font-size: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#lang a {
|
||||||
|
color: white;
|
||||||
|
font-variant: small-caps;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
#name {
|
#name {
|
||||||
display: inline;
|
display: inline;
|
||||||
font-size: 7em;
|
font-size: 7em;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
{% set author = macro::format_name(name=config.extra.name) | striptags -%}
|
{% set author = macro::format_name(name=config.extra.name) | striptags -%}
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="fr">
|
<html lang="{{ lang }}">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
@ -12,7 +12,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="icon" href="favicon.svg">
|
<link rel="icon" href="favicon.svg">
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/modern-normalize/modern-normalize.min.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/modern-normalize/modern-normalize.min.css">
|
||||||
<link rel="stylesheet" type="text/css" href="style.css">
|
<link rel="stylesheet" type="text/css" href="{{ config.base_url }}/style.css">
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto&display=swap">
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto&display=swap">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css" />
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css" />
|
||||||
<title>{{ author }}</title>
|
<title>{{ author }}</title>
|
||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
particlesJS.load('particles', 'particles.json', null);
|
particlesJS.load('particles', '{{ config.base_url | safe }}/particles.json', null);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -9,7 +9,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if page.extra.link %}
|
{% if page.extra.link %}
|
||||||
<a aria-label="external link" class="list_link" href="{{ page.extra.link }}" target="_blank" rel="noopener noreferrer">Découvrir</a>
|
<a aria-label="external link" class="list_link" href="{{ page.extra.link }}" target="_blank" rel="noopener noreferrer">{{ section.extra.discover | default(value="Discover") }}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if not link_after %}
|
{% if not link_after %}
|
||||||
|
@ -2,9 +2,14 @@
|
|||||||
|
|
||||||
{% block content -%}
|
{% block content -%}
|
||||||
|
|
||||||
|
{% set ext = "" -%}
|
||||||
|
{% if config.default_language != lang -%}
|
||||||
|
{% set ext = "." ~ lang -%}
|
||||||
|
{% endif -%}
|
||||||
|
|
||||||
{% set sections = [] -%}
|
{% set sections = [] -%}
|
||||||
{% for section in config.extra.sections | default(value=[]) -%}
|
{% for section in config.extra.sections | default(value=[]) -%}
|
||||||
{% set_global sections = sections | concat(with=get_section(path=section ~ "/_index.md")) -%}
|
{% set_global sections = sections | concat(with=get_section(path=section ~ "/_index" ~ ext ~ ".md")) -%}
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
|
|
||||||
<div id="particles" class="fullflex"></div>
|
<div id="particles" class="fullflex"></div>
|
||||||
@ -12,14 +17,24 @@
|
|||||||
<div id="landing" class="fullflex">
|
<div id="landing" class="fullflex">
|
||||||
<div id="splash">
|
<div id="splash">
|
||||||
|
|
||||||
|
<div id="lang">
|
||||||
|
{%- for lang,tr in config.languages %}
|
||||||
|
{% if config.default_language != lang -%}
|
||||||
|
{% set url = config.base_url ~ "/" ~ lang -%}
|
||||||
|
{% endif -%}
|
||||||
|
{% if not loop.first %}| {% endif -%}
|
||||||
|
<a href="{{ url | default(value=config.base_url | safe) }}">{{ tr.translations.flag | default(value=lang) }}</a>
|
||||||
|
{%- endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
<h1 id="name">
|
<h1 id="name">
|
||||||
{{ macro::format_name(name=config.extra.name) }}
|
{{ macro::format_name(name=config.extra.name) }}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
{% if config.extra.roles -%}
|
{% if section.extra.roles -%}
|
||||||
<div id="roles">
|
<div id="roles">
|
||||||
<p>
|
<p>
|
||||||
{% for role in config.extra.roles -%}
|
{%- for role in section.extra.roles %}
|
||||||
<span>{{ role }}</span><br>
|
<span>{{ role }}</span><br>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</p>
|
</p>
|
||||||
|
Reference in New Issue
Block a user