75 lines
2.2 KiB
HTML
75 lines
2.2 KiB
HTML
|
|
<!DOCTYPE html>
|
|||
|
|
<html lang="{{ config.default_language | default(value="en") }}" data-theme="light">
|
|||
|
|
<head>
|
|||
|
|
<meta charset="utf-8">
|
|||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|||
|
|
|
|||
|
|
<title>
|
|||
|
|
{%- if page is defined and page.title -%}
|
|||
|
|
{{ page.title }} – {{ config.title }}
|
|||
|
|
{%- elif section is defined and section.title -%}
|
|||
|
|
{{ section.title }} – {{ config.title }}
|
|||
|
|
{%- else -%}
|
|||
|
|
{{ config.title }}
|
|||
|
|
{%- endif -%}
|
|||
|
|
</title>
|
|||
|
|
|
|||
|
|
{# Description meta #}
|
|||
|
|
{% if page is defined and page.description %}
|
|||
|
|
<meta name="description" content="{{ page.description }}">
|
|||
|
|
{% elif section is defined and section.description %}
|
|||
|
|
<meta name="description" content="{{ section.description }}">
|
|||
|
|
{% else %}
|
|||
|
|
<meta name="description" content="{{ config.description | default(value="OpenCloud sovereign distributed cloud project") }}">
|
|||
|
|
{% endif %}
|
|||
|
|
|
|||
|
|
<link rel="stylesheet" href="{{ get_url(path="main.css") }}">
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
{% include "partials/header.html" %}
|
|||
|
|
|
|||
|
|
<main class="oc-main">
|
|||
|
|
{% block content %}{% endblock content %}
|
|||
|
|
</main>
|
|||
|
|
|
|||
|
|
{% include "partials/footer.html" %}
|
|||
|
|
<script>
|
|||
|
|
(function () {
|
|||
|
|
const root = document.documentElement;
|
|||
|
|
const stored = localStorage.getItem('oc-theme');
|
|||
|
|
|
|||
|
|
// Default = light
|
|||
|
|
if (stored === 'dark') {
|
|||
|
|
root.setAttribute('data-theme', 'dark');
|
|||
|
|
} else {
|
|||
|
|
root.setAttribute('data-theme', 'light');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
const btn = document.getElementById('oc-theme-toggle');
|
|||
|
|
if (!btn) return;
|
|||
|
|
|
|||
|
|
const updateLabel = () => {
|
|||
|
|
const current = root.getAttribute('data-theme') || 'light';
|
|||
|
|
btn.dataset.theme = current;
|
|||
|
|
if (current === 'dark') {
|
|||
|
|
btn.innerText = '☀ Light';
|
|||
|
|
} else {
|
|||
|
|
btn.innerText = '🌙 Dark';
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
updateLabel();
|
|||
|
|
|
|||
|
|
btn.addEventListener('click', () => {
|
|||
|
|
const current = root.getAttribute('data-theme') === 'dark' ? 'dark' : 'light';
|
|||
|
|
const next = current === 'dark' ? 'light' : 'dark';
|
|||
|
|
root.setAttribute('data-theme', next);
|
|||
|
|
localStorage.setItem('oc-theme', next);
|
|||
|
|
updateLabel();
|
|||
|
|
});
|
|||
|
|
})();
|
|||
|
|
</script>
|
|||
|
|
</body>
|
|||
|
|
</html>
|
|||
|
|
|