summaryrefslogtreecommitdiffstats
path: root/templates/index.html
blob: 63ea8b6f1601486d45e15c980cbf4e6a425d2371 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE HTML>
<html>
    <head>
      <meta charset="UTF-8">
        <link rel="stylesheet" href="{{ get_url(path="main.css") | safe }}">
    </head>
    <body>

    <script>
         fetch('{{ config.extra.release | safe }}')
          .then((response) => {
            return response.json();
          })
          .then((data) => {
            let release_name = data.name;
            let html_url = data.html_url;
            release.innerHTML = `<a href='${html_url}'>${release_name}</a>`;
          });
    </script>

    <main>

      {% block nav %}

        <nav>
          {% if config.extra.logo %}
            {% if current_path == "/" %}
            <img src="{{ config.extra.logo | safe }}" alt="" />

            {% else %}<a href="/">
            <img src="{{ config.extra.logo | safe }}" alt="" />
                </a>
            {% endif %}
            
          {% else %}
            <h1><a href="{{ config.base_url }}">{{ config.title }}</a></h1>
          {% endif %}

          {% if config.extra.release %}
            <div id="release"></div>
          {% endif %}
  
  <a href="javascript:void(0);" onclick="burger()" id="mobile" class="ms-Icon--GlobalNavButton"></a>
    <div id="trees">
        {% set section = get_section(path="_index.md") %}       
            {% for p in section.subsections %}
                {% set subsection = get_section(path=p) %} 
            
 
        <input class="tree-toggle" type="checkbox" id="{{ subsection.title | slugify  }}" 
        {% if current_path is starting_with(subsection.path) %}checked{% endif %} />
        <label class="tree-toggle-label" for="{{ subsection.title | slugify  }}">{{ subsection.title }}</label>
                        
        <ul class="subtree">
                {% for page in subsection.pages %}
                                <li class="{% if current_path == page.path %}active{% endif %}">
                                    <a href="{{page.permalink}}">{{page.title}}</a>
                                </li>

                            {% if current_path == page.path %} 
                                
  {% set_global header_count = 0 %}
  {% for h2 in page.toc %}
    {% set_global header_count = header_count + 1 %}
    {% for h3 in h2.children %}
      {% set_global header_count = header_count + 1 %}
      {% for h4 in h3.children %}
        {% set_global header_count = header_count + 1 %}
      {% endfor %}
    {% endfor %}
  {% endfor %}

  {% if header_count > 4 %}
      <ul id="toc">
        {% for h2 in page.toc %}
          <li><a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
          {% if h2.children %}
          <ul>        
            {% for h3 in h2.children %}
            <li><a href="{{ h3.permalink | safe }}">{{ h3.title }}</a></li>
            {% endfor %}
         </ul>
  {% endif %}
        </li>
  {% endfor %}
      </ul>
  {% endif %}

                        
{% endif %}

                                
                {% endfor %}
        </ul>         
                {% endfor %}
              </div>    </nav>
    {% endblock nav %}

<article>
 
  {% if config.build_search_index %}
  <div id="on_right">
    <span id="search-ico" class="ms-Icon--Search"></span>
  </div>
    <div class="search-container">
          <input id="search" type="search" placeholder="Search as you type...">
            <div class="search-results">
              <div class="search-results__header"></div>
                <ul class="search-results__items"></ul>
              </div>
    </div>
  {% endif %}       

<div id="wrap">
{% block content %}


    {{ section.content | safe }}

{% endblock content %}
</div>

</article>


</main> 

{% if config.build_search_index %}
<script type="text/javascript" src="{{ get_url(path="elasticlunr.min.js") | safe }}"></script>
<script type="text/javascript" src="{{ get_url(path="search_index.en.js") | safe }}"></script>
<script type="text/javascript" src="{{ get_url(path="js.js") | safe }}" defer></script>
{% endif %}

</body>
</html>