This commit is contained in:
2025-09-06 16:50:16 +02:00
commit 534175efb3
62 changed files with 14264 additions and 0 deletions

35
templates/base.html.twig Normal file
View File

@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="{{ app.request.locale|default(app.request.defaultLocale|default('en')) }}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}{{ 'site.name'|trans }}{% endblock %}</title>
{% block stylesheets %}{% endblock %}
</head>
<body>
<header>
<nav>
{% set pathinfo = app.request.pathinfo %}
{% set is_nl = pathinfo starts with '/nl' %}
<a href="{{ is_nl ? '/nl' : '/' }}">{{ 'nav.home'|trans }}</a> |
<a href="{{ is_nl ? '/nl/game' : '/game' }}">{{ 'nav.game'|trans }}</a>
<span style="margin-left:1rem">
{# Language switcher: URL prefix strategy. Our routes have localized prefixes: en (no prefix), nl (/nl). #}
{% set pathinfo = app.request.pathinfo %}
{% set is_nl = pathinfo starts with '/nl' %}
{% set en_url = is_nl ? pathinfo|slice(3) : pathinfo %}
{% set nl_url = is_nl ? pathinfo : '/nl' ~ pathinfo %}
<a href="{{ en_url ?: '/' }}">EN</a> /
<a href="{{ nl_url }}">NL</a>
</span>
</nav>
</header>
<main>
{% block body %}{% endblock %}
</main>
<footer>
<small>&copy; {{ "now"|date("Y") }} {{ 'site.name'|trans }}</small>
</footer>
{% block javascripts %}{% endblock %}
</body>
</html>