2024-01-02 02:52:40 +01:00
|
|
|
{% import "macros/svg.html" as svg %}
|
2024-01-02 12:18:18 +01:00
|
|
|
{% extends "page.html" %}
|
2023-07-04 02:37:44 +02:00
|
|
|
|
|
|
|
{% block content %}
|
2024-01-02 02:31:44 +01:00
|
|
|
<div class="home-container"><div class="home">
|
|
|
|
{% if config.extra.home.title %}
|
|
|
|
<h1>{{ config.extra.home.title }}</h1>
|
2023-12-26 01:11:47 +01:00
|
|
|
{% else %}
|
|
|
|
<h1>{{ config.title }}</h1>
|
|
|
|
{% endif %}
|
2024-01-02 02:31:44 +01:00
|
|
|
{% if config.extra.home.subtitle %}
|
2024-01-02 02:52:40 +01:00
|
|
|
<p>{{ config.extra.home.subtitle }}<span id="subtitle-rand"></span></p>
|
2023-12-26 01:11:47 +01:00
|
|
|
{% elif config.description %}
|
2024-01-02 02:52:40 +01:00
|
|
|
<p>{{ config.description }}<span id="subtitle-rand"></span></p>
|
|
|
|
{% endif %}
|
|
|
|
{% if config.extra.home.social_icons %}
|
|
|
|
{{ svg::draw_icons(icons=config.extra.home.social_icons) }}
|
2023-12-26 01:11:47 +01:00
|
|
|
{% endif %}
|
2023-12-25 02:39:41 +01:00
|
|
|
</div></div>
|
2024-01-20 17:28:18 +01:00
|
|
|
{% if config.extra.home.random_api and config.extra.home.random_api_param %}
|
|
|
|
<script>
|
|
|
|
async function fetchSubtitle() {
|
|
|
|
let element = document.getElementById("subtitle-rand")
|
|
|
|
try {
|
|
|
|
let res = await fetch("{{ config.extra.home.random_api | safe }}");
|
|
|
|
let doc = await res.json();
|
|
|
|
element.innerHTML = `${doc.{{ config.extra.home.random_api_param }}}`;
|
|
|
|
} catch (e) {
|
|
|
|
console.log(e);
|
|
|
|
element.textContent = ", seemingly incapable to configure nginx";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fetchSubtitle();
|
|
|
|
</script>
|
|
|
|
{% elif config.extra.home.subtitle_suffixes %}
|
2024-01-02 02:52:40 +01:00
|
|
|
<script> //random subtitle logic
|
2023-12-22 12:19:19 +01:00
|
|
|
const suffixes = [
|
2024-01-02 02:31:44 +01:00
|
|
|
{% for s in config.extra.home.subtitle_suffixes %}
|
2023-12-26 01:11:47 +01:00
|
|
|
"{{ s }}",
|
|
|
|
{% endfor %}
|
2023-12-22 12:19:19 +01:00
|
|
|
]
|
|
|
|
var current = suffixes[Math.floor(Math.random() * suffixes.length)];
|
2024-01-02 02:52:40 +01:00
|
|
|
var span = document.getElementById("subtitle-rand");
|
2023-12-22 12:19:19 +01:00
|
|
|
span.textContent = current;
|
|
|
|
</script>
|
|
|
|
{% endif %}
|
2023-07-04 02:37:44 +02:00
|
|
|
{% endblock content %}
|