Skip to content

Commit feb534c

Browse files
committed
dropdown navbar
1 parent 86211a9 commit feb534c

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

_data/nav.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
- title: About
22
url: /about/
3+
sections:
4+
- title: Charter
5+
url: /charter/
6+
- title: Roadmap
7+
url: /roadmap/
38
- title: News
49
url: /news/
510
- title: Development

_includes/nav.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313
{% else %}
1414
<a href="{{ site.baseurl }}{{ nav.url }}">{{ nav.title }}</a>
1515
{% endif %}
16+
{% if nav.sections != null %}
17+
<ul>
18+
{% for section in nav.sections %}
19+
<li>
20+
{% if section.url contains 'http://' or section.url contains 'https://' %}
21+
<a href="{{ section.url }}">{{ section.title }}</a>
22+
{% else %}
23+
<a href="{{ site.baseurl }}{{ section.url }}">{{ section.title }}</a>
24+
{% endif %}
25+
</li>
26+
{% endfor %}
27+
</ul>
28+
{% endif %}
1629
</li>
1730
{% endfor %}
1831
</ul>

about.html renamed to charter.html

File renamed without changes.

css/main.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,14 @@ pre {
126126
float: right;
127127
}
128128
.site-nav ul {
129+
position: relative;
129130
list-style: none;
131+
display: inline-table;
132+
}
133+
.site-nav ul:after {
134+
content: "";
135+
clear: both;
136+
display: block;
130137
}
131138
.site-nav li {
132139
display: inline-block;
@@ -136,6 +143,28 @@ pre {
136143
font-family: 'Lato', sans-serif;
137144
position: relative;
138145
}
146+
.site-nav ul ul {
147+
background: #3C92D1;
148+
font-size: 16px;
149+
display: none;
150+
padding: 0;
151+
position: absolute;
152+
top: 100%;
153+
}
154+
.site-nav ul li:hover > ul {
155+
display: block;
156+
}
157+
.site-nav ul ul li {
158+
margin: 0px;
159+
padding: 5px;
160+
width: 100%;
161+
}
162+
.site-nav ul ul li:hover {
163+
background: #47ACF5;
164+
}
165+
.site-nav ul ul li a {
166+
color: #FFF;
167+
}
139168
.col-half {
140169
display: table-cell;
141170
width: 50%;

0 commit comments

Comments
 (0)