-
Notifications
You must be signed in to change notification settings - Fork 150
/
docs.liquid
89 lines (79 loc) · 2.98 KB
/
docs.liquid
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
---
layout: default
---
<div class="container-lg px-3 py-6">
<div class="d-md-flex flex-md-row flex-md-row-reverse gutter-md-spacious">
<div class="col-md-9 markdown-body p-md-6">
{{ content }}
{% for doc in collections.docs %}
{% if docs.data.next == doc.inputPath %}
{% assign next = doc %}
{% endif %}
{% if doc.next == page.inputPath %}
{% assign previous = doc %}
{% endif %}
{% endfor %}
<div class="d-flex border-bottom border-gray-light mt-6 mb-3 py-3 color-text-tertiary">
<div class="col-6">
{% if previous %}
{% octicon "chevron-left" class="v-align-text-bottom" %}
<a href="{{ previous.url }}">{{ previous.title }}</a>
{% endif %}
</div>
<div class="col-6 text-right">
{% if next %}
<a href="{{ next.url }}">{{ next.title }}</a>
{% octicon "chevron-right" class="v-align-text-bottom" %}
{% endif %}
</div>
</div>
<p class="alt-text-small color-text-tertiary">
Found a mistake or want to help improve this documentation?
<a href="https://github.com/probot/probot/edit/master/{{ docs.template.templateData.fileSlug.inputPath }}">Suggest changes on GitHub</a>
</p>
</div>
<div id="toc" class="col-md-3 py-6">
<div class="toc-wrap">
{% for section in toc %}
<h2 class="h4">{{ section[0] }}</h2>
<ul class="mt-2 mb-4 list-style-none">
{% for item in section[1] %}
<li>
{% if item.url %}
{% assign targeturl = item.url %}
{% assign targettext = item.title %}
{% else %}
{% for doc in collections.docs %}
{% assign documentbase = "docs/" | append: doc.template.parsed.base %}
{% assign documentbasepath = doc.template.parsed.base | slug %}
{% assign documentbaseurl = "/docs/" | append: documentbasepath %}
{% if documentbase == item %}
{% assign targeturl = documentbaseurl %}
{% assign targettext = doc.data.title %}
{% break %}
{% endif %}
{% endfor %}
{% endif %}
{% if page.url == targeturl %}
{% assign classes = "text-brand-red" %}
{% else %}
{% assign classes = "color-text-tertiary" %}
{% endif %}
<a class="d-block no-underline py-1 {{classes}}" href="{{ targeturl }}">{{ targettext }}</a>
</li>
{% endfor %}
</ul>
{% endfor %}
</div>
</div>
</div>
</div>
<script src="/assets/js/anchor.min.js"></script>
<script type="text/javascript">
anchors.options = {
placement: 'left',
class: 'color-text-secondary no-underline'
};
anchors.add();
anchors.remove('.h4');
</script>