diff options
Diffstat (limited to 'website/templates')
| -rw-r--r-- | website/templates/index.html | 2 | ||||
| -rw-r--r-- | website/templates/macros.html | 10 |
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> {#- -#} |
