feat: add minijinja as template engine

This commit is contained in:
Alexander Navarro 2025-02-14 11:29:03 -03:00
parent 5a9b871e42
commit 6cb75aa442
10 changed files with 150 additions and 31 deletions

View file

@ -2,9 +2,19 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Compendium</title>
<title>
{% block title %}Axum web service!{% endblock %}
</title>
</head>
<body>
<h1>Hello world!</h1>
{% include "partials/header.html" %}
<main>
<nav class="msp-d-sm-none msp-d-flex msp-justify-content-end">
<button class="msp-offcanvas-toggle" data-msp-target="#main-offcanvas">Toggle</button>
</nav>
{% block content %}{% endblock %}
</main>
</body>
</html>

0
templates/index.html Normal file
View file

View file

@ -0,0 +1,34 @@
<aside id="main-offcanvas" class="msp-offcanvas msp-offcanvas-sm">
<div class="msp-offcanvas-backdrop msp-offcanvas-toggle"
data-msp-target="#main-offcanvas"></div>
<div class="msp-offcanvas-content">
<div class="msp-offcanvas-body">
<ul class="msp-list-unstyle msp-accordion">
<li>
<a href="/">Overview</a>
</li>
{% for page in global_routes %}
<li class="msp-accordion-item">
<a class="msp-accordion-header" href="{{ page.path }}">{{ page.text }}</a>
{% if page.subpages.length > 0 %}
}
<div class="msp-accordion-collapse">
<ul class="msp-list-unstyle msp-accordion-content">
{% for subpage in page.subpages %}
<li class="">
<a href="{{ subpage.path }}">{{ subpage.text }}</a>
</li>
{% endfor %}
</ul>
</div>
{
{% endif %}
</li>
{% endfor %}
</ul>
</div>
</div>
</aside>