summaryrefslogtreecommitdiffstats
path: root/theme/templates/site.html
blob: 13438ed371d234714a384e8cf025fda574a7f7ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{% extends "layout.html" %}

{% block htmlTag %}manifest="{{ basePath }}/manifest.appcache"{% endblock %}
{% block title %}{{ progress.current.title }}{% parent %}{% endblock %}
{% block content %}
    <div class="book" {% if githubId %}data-github="{{ githubId }}"{% endif %} data-level="{{ progress.current.level }}" data-basepath="{{ basePath }}" data-revision="{{ revision }}">
    {% include "includes/book/header.html" %}
    {% include "includes/book/summary.html" %}
    <div class="book-body">
        <div class="body-inner">
            <div class="page-wrapper" tabindex="-1">
                {% include "includes/book/progress.html" %}

                <div class="page-inner">
                {% for section in content %}
                    <section class="{{ section.type }}" id="section-{{ section.id }}">
                    {% if section.type == "normal" %}
                        {% autoescape false %}{{ section.content }}{% endautoescape %}
                    {% elif section.type == "exercise" %}
                        {% include "./includes/book/exercise.html" with {section: section} %}
                    {% elif section.type == "quiz" %}
                        {% include "./includes/book/quiz.html" with {section: section} %}
                    {% endif %}
                    </section>
                {% endfor %}
                </div>
            </div>
        </div>

        {% if progress.current.prev and progress.current.prev.path %}
        <a href="{{ basePath }}/{{ progress.current.prev.path|mdLink }}" class="navigation navigation-prev {% if !progress.current.next or !progress.current.next.path %}navigation-unique{% endif %}"><i class="fa fa-angle-left"></i></a>
        {% endif %}
        {% if progress.current.next and progress.current.next.path %}
        <a href="{{ basePath }}/{{ progress.current.next.path|mdLink }}" class="navigation navigation-next {% if !progress.current.prev or !progress.current.prev.path %}navigation-unique{% endif %}"><i class="fa fa-angle-right"></i></a>
        {% endif %}
    </div>
</div>
{% endblock %}

{% block javascript %}
{% parent %}
{% for resource in plugins.resources.js %}
    {% if resource.url %}
    <script src="{{ resource.url }}"></script>
    {% else %}
    <script src="{{ staticBase }}/plugins/{{ resource.path }}"></script>
    {% endif %}
{% endfor %}
<script>
require(["gitbook"], function(gitbook) {
    var config = {% autoescape false %}{{ pluginsConfig }}{% endautoescape %};
    gitbook.start(config);
});
</script>
{% endblock %}

{% block style %}
{% parent %}
{% for resource in plugins.resources.css %}
    {% if resource.url %}
    <link rel="stylesheet" href="{{ resource.url }}">
    {% else %}
    <link rel="stylesheet" href="{{ staticBase }}/plugins/{{ resource.path }}">
    {% endif %}
{% endfor %}
{% endblock %}