summaryrefslogtreecommitdiffhomepage
path: root/website/_layouts/docs.html
blob: 5b95dc0711c02eef32594ac3fa93a12f4c3fc21b (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
---
layout: base
categories:
  - Project
  - User Guide
  - Architecture Guide
  - Compatibility
---

<div class="container">
  <div class="row">
    <div class="col-md-3">
      <nav class="sidebar" id="sidebar-nav">
        {% for category in layout.categories %}
          <h3>{{ category }}</h3>
          <ul class="sidebar-nav">
          {% assign subcats = site.pages | where: 'layout', 'docs' | where: 'category', category | group_by: 'subcategory' | sort: 'name', 'first' %}
          {% for subcategory in subcats %}
            {% assign sorted_pages = subcategory.items | where: 'include_in_menu', true | sort: 'weight', 'last' %}
            {% comment %}If all pages in the subcategory are excluded don't show it.{% endcomment %}
            {% if sorted_pages.size > 0 %}
              {% if subcategory.name != "" %}
                {% assign cid = category | remove: " " | downcase %}
                {% assign sid = subcategory.name | remove: " " | downcase %}
                <li>
                  {% comment %}
                  If the current page is in the sub-category then set the collapsible to expanded.
                  See: https://getbootstrap.com/docs/3.3/javascript/#collapse
                  {% endcomment %}
                  {% assign expanded = false %}
                  {% for p in sorted_pages %}{% if page.url == p.url %}{% assign expanded = true %}{% endif %}{% endfor %}
                  <a class="sidebar-nav-heading" data-toggle="collapse" href="#{{ cid }}-{{ sid }}" {% if expanded %}aria-expanded="true"{% else %}aria-expanded="false"{% endif %} aria-controls="{{ cid }}-{{ sid }}">{{ subcategory.name }}<span class="caret"></span></a>
                  <ul class="collapse{% if expanded %} in{% endif %} sidebar-nav sidebar-submenu" id="{{ cid }}-{{ sid }}">
              {% endif %}
              {% for p in sorted_pages %}
                <li{% if page.url == p.url %} class="active"{% endif %}><a href="{{ p.url }}">{{ p.title }}</a></li>
              {% endfor %}
              {% if subcategory.name != "" %}
                </li>
              </ul>
              {% endif %}
            {% endif %}
          {% endfor %}
          </ul>
        {% endfor %}
      </nav>
    </div>

    <div class="col-md-9">
      <h1>{{ page.title }}</h1>
      {% if page.editpath %}
        <p>
        <a href="https://github.com/google/gvisor/edit/master/{{page.editpath}}" target="_blank" rel="noopener"><i class="fa fa-edit fa-fw"></i> Edit this page</a>
        <a href="https://github.com/google/gvisor/issues/new?title={{page.title | url_encode}}" target="_blank" rel="noopener"><i class="fab fa-github fa-fw"></i> Create issue</a>
        </p>
      {% endif %}
      <div class="docs-content">
      {{ content }}
      </div>
    </div>
  </div>
</div>