summaryrefslogtreecommitdiffstats
path: root/theme
diff options
context:
space:
mode:
Diffstat (limited to 'theme')
-rw-r--r--theme/templates/page.html27
1 files changed, 27 insertions, 0 deletions
diff --git a/theme/templates/page.html b/theme/templates/page.html
index a479884..6b8c6ca 100644
--- a/theme/templates/page.html
+++ b/theme/templates/page.html
@@ -87,6 +87,33 @@
</section>
{% endif %}
{% endfor %}
+
+
+ {# Exercise solutions #}
+ {% if exercise > 0 %}
+ {% set exercise = 0 %}
+ <section>
+ <article class="new-chapter">
+ <h1>Exercise Solutions</h1>
+ </article>
+ <article>
+ {% for item in summary.chapters %}
+ {% for article in item.articles %}
+ {% for section in pages[article.path].content %}
+ {% if section.type == "exercise" %}
+ <div class="exercise">
+ <div class="exercise-header">Exercise #{{ exercise }}</div>
+ {% autoescape false %}{{ section.content }}{% endautoescape %}
+ <pre><code>{% autoescape false %}{{ section.code.solution|code }}{% endautoescape %}</code></pre>
+ {% set exercise = exercise + 1 %}
+ </div>
+ {% endif %}
+ {% endfor %}
+ {% endfor %}
+ {% endfor %}
+ </article>
+ </section>
+ {% endif %}
{% endblock %}
{% block javascript %}{% endblock %} \ No newline at end of file