Skip to content

Commit 85dc94b

Browse files
authored
Merge pull request #96 from vinayaksh42/docsui
[Site] sub-sections for Docs
2 parents 5fe7527 + 638be78 commit 85dc94b

File tree

10 files changed

+88
-24
lines changed

10 files changed

+88
-24
lines changed

docs/Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ GEM
1717
forwardable-extended (2.6.0)
1818
htmlcompressor (0.4.0)
1919
http_parser.rb (0.6.0)
20-
i18n (1.8.9)
20+
i18n (1.8.10)
2121
concurrent-ruby (~> 1.0)
2222
jekyll (4.1.1)
2323
addressable (~> 2.4)
@@ -63,7 +63,7 @@ GEM
6363
kramdown-parser-gfm (1.1.0)
6464
kramdown (~> 2.0)
6565
liquid (4.0.3)
66-
listen (3.5.0)
66+
listen (3.5.1)
6767
rb-fsevent (~> 0.10, >= 0.10.3)
6868
rb-inotify (~> 0.9, >= 0.9.10)
6969
mercenary (0.4.0)

docs/_data/docs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- name: Section 1
2+
number: One
3+
- name: Section 2
4+
number: Two
5+
- name: Section 3
6+
number: Three

docs/_includes/faq.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h1 class="title">FAQs</h1>
66
<div class="accordion accordion-flush" id="accordionFlushExample">
77
<div class="accordion-item">
88
<h2 class="accordion-header" id="flush-headingOne">
9-
<button id="faq-title" class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="false" aria-controls="flush-collapseOne">
9+
<button id="faq-title" class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="true" aria-controls="flush-collapseOne">
1010
Can I still build Nighthawk myself?
1111
</button>
1212
</h2>

docs/_layouts/docs.html

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,39 @@
4040
</button>
4141

4242
<div class="collapse navbar-collapse" id="navbarSupportedContent">
43-
44-
<ul class="sidebar">
45-
<h4 class="doc-heading">Documentation</h4>
46-
{% for doc in site.docs %}
47-
<li>
48-
<h5 ><a class="doc-link" href="{% include relative-src.html src=doc.url %}">{{ doc.title }}</a></h5>
49-
</li>
43+
<ul class="sidebar">
44+
<div class="accordion accordion-flush" id="accordionFlushExample">
45+
{% for docs in site.data.docs %}
46+
<div class="accordion-item">
47+
<h2 class="accordion-header" id="flush-heading{{docs.number}}">
48+
<button id="faq-title" class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapse{{docs.number}}" aria-expanded="false" aria-controls="flush-collapse{{docs.number}}">
49+
<h4 class="doc-heading">{{ docs.name }}</h4>
50+
</button>
51+
</h2>
52+
<div id="flush-collapse{{docs.number}}" class="accordion-collapse collapse" aria-labelledby="flush-heading{{docs.number}}" data-bs-parent="#accordionFlushExample">
53+
{% for doc in site.docs %}
54+
{% if doc.section == docs.name %}
55+
<li>
56+
<h5>
57+
<a
58+
class="doc-link"
59+
href="{% include relative-src.html src=doc.url %}"
60+
>{{ doc.title }}</a
61+
>
62+
</h5>
63+
</li>
64+
{% endif %}
65+
{% endfor %}
66+
</div>
67+
</div>
5068
{% endfor %}
51-
</ul>
69+
</div>
70+
</ul>
5271
</div>
5372
</nav>
5473
</div>
5574
<div class="col-lg-9 container-g">
75+
{{ foo }}
5676
{{content}}
5777
</div>
5878
</div>

docs/_sass/getnighthawk.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5972,3 +5972,9 @@ div.globalFooterCard.card-environment {
59725972
font-size: 14px;
59735973
}
59745974
}
5975+
.accordion-button {
5976+
border: 0px !important;
5977+
}
5978+
.accordion-button::after {
5979+
margin-left: 10px !important;
5980+
}

docs/collections/_docs/really-using-getnighthawk.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: docs
33
title: Overview
4+
section: "Section 1"
45
---
56
# Nighthawk: architecture and key concepts
67

docs/collections/_docs/section2.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
layout: docs
3+
title: Overview
4+
section: "Section 2"
5+
---
6+
7+
Test section 2

docs/collections/_docs/section3.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
layout: docs
3+
title: Overview
4+
section: "Section 3"
5+
---
6+
7+
Test section 3
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
layout: docs
3-
title: Using GetNighthawk
3+
title: GetNighthawk
4+
section: "Section 1"
45
---
56
Test

docs/pages/docs.html

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,34 @@
9393

9494
<div class="collapse navbar-collapse" id="navbarSupportedContent">
9595
<ul class="sidebar">
96-
<h4 class="doc-heading">Documentation</h4>
97-
{% for doc in site.docs %}
98-
<li>
99-
<h5>
100-
<a
101-
class="doc-link"
102-
href="{% include relative-src.html src=doc.url %}"
103-
>{{ doc.title }}</a
104-
>
105-
</h5>
106-
</li>
107-
{% endfor %}
96+
97+
<div class="accordion accordion-flush" id="accordionFlushExample">
98+
{% for docs in site.data.docs %}
99+
<div class="accordion-item">
100+
<h2 class="accordion-header" id="flush-heading{{docs.number}}">
101+
<button id="faq-title" class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapse{{docs.number}}" aria-expanded="false" aria-controls="flush-collapse{{docs.number}}">
102+
<h4 class="doc-heading">{{ docs.name }}</h4>
103+
</button>
104+
</h2>
105+
<div id="flush-collapse{{docs.number}}" class="accordion-collapse collapse" aria-labelledby="flush-heading{{docs.number}}" data-bs-parent="#accordionFlushExample">
106+
{% for doc in site.docs %}
107+
{% if doc.section == docs.name %}
108+
<li>
109+
<h5>
110+
{% assign foo = docs.name %}
111+
<a
112+
class="doc-link"
113+
href={% include relative-src.html src=doc.url %}
114+
>{{ doc.title }}</a
115+
>
116+
</h5>
117+
</li>
118+
{% endif %}
119+
{% endfor %}
120+
</div>
121+
</div>
122+
{% endfor %}
123+
</div>
108124
</ul>
109125
</div>
110126
</nav>

0 commit comments

Comments
 (0)