summaryrefslogtreecommitdiff
path: root/website/templates
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2025-05-17 15:49:26 +0200
committermo8it <mo8it@proton.me>2025-05-17 15:49:26 +0200
commitf387f4c1d9d5a2b7b78d454e16a180f49bc63d1c (patch)
treea3b05961b954503e959d92b56a3acb0d315f56f9 /website/templates
parentb30973afa1d76bdbeb1104cc662db4f27407c805 (diff)
Add setup and usage pages
Diffstat (limited to 'website/templates')
-rw-r--r--website/templates/index.html2
-rw-r--r--website/templates/macros.html10
2 files changed, 3 insertions, 9 deletions
diff --git a/website/templates/index.html b/website/templates/index.html
index 5877765..c61defd 100644
--- a/website/templates/index.html
+++ b/website/templates/index.html
@@ -6,6 +6,6 @@
<div class="m-3">
<h1>Rustlings</h1>
- {{ section.content | replace(from="<!-- toc -->", to=macros::toc() ) | safe }}
+ {{ section.content | safe }}
</div>
{% endblock %}
diff --git a/website/templates/macros.html b/website/templates/macros.html
index ce517b0..dd7b928 100644
--- a/website/templates/macros.html
+++ b/website/templates/macros.html
@@ -1,15 +1,9 @@
{% macro toc() %}
- {%- if page.toc -%}
- {% set_global toc = page.toc %}
- {%- else -%}
- {% set_global toc = section.toc %}
- {%- endif -%}
-
- {% if toc %}
+ {% if page.toc %}
<div class="px-4 py-0.5 my-3 border-s-4 rounded-xl border-double">
<nav>
<ul class="ml-0 list-none">
- {% for parent in toc %}
+ {% for parent in page.toc %}
{% if parent.level == 2 %}
<li>
{#- -#}