Skip to content

Commit c54a239

Browse files
committed
Make menu collapse on smaller screens, use bower for js
1 parent 292d6ee commit c54a239

File tree

7 files changed

+60
-93
lines changed

7 files changed

+60
-93
lines changed

doc/bower.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
"dependencies": {
1717
"font-awesome": "~4.2.0",
1818
"bootswatch": "~3.3.1+2",
19-
"highlightjs": "~8.4.0"
19+
"highlightjs": "~8.4.0",
20+
"jquery": "~2.1.3"
21+
},
22+
"resolutions": {
23+
"jquery": "~1.11.0"
2024
}
2125
}

doc/couscous.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,26 @@ subTitle: An asynchronous job scheduling server.
99
menu:
1010
items:
1111
home:
12-
text: '<span class="fa fa-fw fa-home"></span> Welcome'
12+
text: Welcome
13+
iconClass: 'fa fa-fw fa-home'
1314
relativeUrl: index.html
1415
getting-started:
15-
text: '<span class="fa fa-fw fa-power-off"></span> Getting Started'
16+
text: Getting Started
17+
iconClass: 'fa fa-fw fa-power-off'
1618
relativeUrl: getting-started.html
1719
configuration:
18-
text: '<span class="fa fa-fw fa-gear"></span> Configuration'
20+
text: Configuration
21+
iconClass: 'fa fa-fw fa-gear'
1922
relativeUrl: configuration.html
2023
integration-jobs:
21-
text: '<span class="fa fa-fw fa-exchange"></span> Integration Jobs'
24+
text: Integration Jobs
25+
iconClass: 'fa fa-fw fa-exchange'
2226
relativeUrl: integration-jobs.html
2327
web-api:
24-
text: '<span class="fa fa-fw fa-cloud"></span> Web API'
28+
text: Web API
29+
iconClass: 'fa fa-fw fa-cloud'
2530
relativeUrl: web-api.html
2631
change-log:
27-
text: '<span class="fa fa-fw fa-refresh"></span> Change Log'
32+
text: Change Log
33+
iconClass: 'fa fa-fw fa-refresh'
2834
relativeUrl: change-log.html

doc/website/README.md

Lines changed: 0 additions & 65 deletions
This file was deleted.

doc/website/css/main.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,17 @@ header.navbar {
8484
position:fixed;
8585
margin-top: 30px;
8686
}
87+
#menu-navbar {
88+
display: none !important;
89+
}
90+
}
91+
92+
@media (max-width: 767px) {
93+
#sidebar {
94+
display: none !important;
95+
}
8796
}
97+
8898
@media (max-width: 960px) {
8999
body {
90100
font-size: 17px;

doc/website/default.twig

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,38 @@
1414
<body>
1515

1616
<header class="navbar navbar-default navbar-fixed-top">
17-
18-
<a class="navbar-brand" href="{{ baseUrl }}/">
19-
{{ title|default('The title') }}
20-
<small class="hidden-xs hidden-sm">
21-
{{ subTitle|default('This is the default subtitle!') }}
22-
</small>
23-
</a>
24-
17+
<div class="navbar-header">
18+
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#menu-navbar">
19+
<span class="sr-only">Toggle navigation</span>
20+
<span class="fa fa-fw fa-bars"></span>
21+
</button>
22+
<a class="navbar-brand" href="{{ baseUrl }}/">
23+
{{ title|default('The title') }}
24+
<small class="hidden-xs hidden-sm">
25+
{{ subTitle|default('This is the default subtitle!') }}
26+
</small>
27+
</a>
28+
</div>
29+
{% if menu is defined %}
30+
<div id="menu-navbar" class="collapse navbar-collapse">
31+
<nav role="navigation">
32+
<ul class="nav">
33+
{{ include('menu.twig') }}
34+
</ul>
35+
</nav>
36+
</div>
37+
{% endif %}
2538
</header>
2639

2740
<main class="{{ menu ? 'container-fluid' : 'container' }}">
2841
<div class="row">
2942

3043
{% if menu is defined %}
31-
3244
<nav id="sidebar" class="col-sm-3 col-lg-2" role="navigation">
33-
3445
<ul class="nav nav-pills nav-stacked">
35-
{% for itemId, item in menu.items %}
36-
<li class="{{ itemId == currentMenu ? 'active' }}">
37-
<a href="{{ item.absoluteUrl|default(baseUrl ~ '/' ~ item.relativeUrl) }}">
38-
{{ item.text|raw }}
39-
</a>
40-
</li>
41-
{% endfor %}
46+
{{ include('menu.twig') }}
4247
</ul>
43-
4448
</nav>
45-
4649
{% endif %}
4750

4851
<section id="content" class="{{ menu ? 'col-sm-offset-3 col-lg-offset-2 col-sm-9 col-lg-10' : 'col-sm-12' }}">
@@ -61,8 +64,9 @@
6164
</footer>
6265

6366
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
64-
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
65-
<script src="http://yastatic.net/highlightjs/8.2/highlight.min.js"></script>
67+
<script src="bower_components/jquery/dist/jquery.min.js"></script>
68+
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
69+
<script src="bower_components/highlightjs/highlight.pack.js"></script>
6670

6771
<script>
6872
$(function() {

doc/website/menu-items.twig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{% for itemId, item in menu.items %}
2+
<li class="{{ itemId == currentMenu ? 'active' }}">
3+
<a href="{{ item.absoluteUrl|default(baseUrl ~ '/' ~ item.relativeUrl) }}">
4+
<span class="{{ item.iconClass }}"></span>
5+
<span>{{ item.text|raw }}</span>
6+
</a>
7+
</li>
8+
{% endfor %}

doc/website/screenshot.png

-176 KB
Binary file not shown.

0 commit comments

Comments
 (0)