Skip to content

Commit e4b644b

Browse files
committed
Add 'quick nav' search box and associated results drop-down
1 parent 3978a0b commit e4b644b

13 files changed

Lines changed: 409 additions & 35 deletions

File tree

_config.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,24 @@ gems:
99
defaults:
1010
-
1111
scope:
12-
path: "docs"
12+
path: "docs/"
1313
type: "pages"
1414
values:
1515
layout: "docs"
1616
category: "docs"
17+
-
18+
scope:
19+
path: "docs/drivers"
20+
type: "pages"
21+
values:
22+
layout: "docs"
23+
categories: "docs drivers"
1724
-
1825
scope:
1926
path: "docs/tutorials"
2027
type: "pages"
2128
values:
22-
category: "tutorials"
29+
categories: "tutorials docs"
2330
-
2431
scope:
2532
path: "docs/drivers"
@@ -31,7 +38,7 @@ defaults:
3138
path: "docs/sensors"
3239
type: "pages"
3340
values:
34-
category: "sensors"
41+
categories: "sensors docs"
3542
-
3643
scope:
3744
path: ""

_includes/breadcrumbs.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{% assign parent_dirs=page.url | replace_first: '/', '' | split: '/' %}
2+
{% assign link='/' %}
3+
{% for dir in parent_dirs %}
4+
{% if forloop.last %}
5+
{{ dir }}
6+
{% else %}
7+
{% assign link=link | append: dir | append: '/' %}
8+
<a href="{{ link }}">{{ dir }}</a> &gt;
9+
{% endif %}
10+
{% endfor %}

_includes/head.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
<title>{{ page.title }}</title>
55
<link rel="stylesheet" href="{{ site.github.url }}/stylesheets/styles.css">
66
<link rel="stylesheet" href="{{ site.github.url }}/stylesheets/pygment_trac.css">
7-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
7+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
8+
<script src="{{ site.github.url }}/javascripts/jquery.loadTemplate-1.4.4.min.js"></script>
89
<script src="{{ site.github.url }}/javascripts/respond.js"></script>
910
<script src="{{ site.github.url }}/javascripts/cards.js"></script>
1011
<script src="{{ site.github.url }}/javascripts/menu.js"></script>
12+
<script src="{{ site.github.url }}/javascripts/search.js"></script>
1113
<!--[if lt IE 9]>
1214
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
1315
<![endif]-->
@@ -16,4 +18,12 @@
1618
<![endif]-->
1719
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
1820

21+
<script type="text/html" id="search-result-template">
22+
<div class="search-result">
23+
<a data-href="href"><h4 data-content="title"></h4></a>
24+
<span data-content="breadcrumbs" class="search-result-breadcrumbs"></span>
25+
<span data-content="author" class="search-result-author"></span>
26+
</div>
27+
</script>
28+
1929
</head>

_includes/header.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,31 @@
1717
<a href="{{ site.github.url }}/contributing" title="How to contribute to ev3dev">Contributing</a>
1818
</li>
1919
<!-- items below float right, so appear in reverse order -->
20+
<li class="right headerBox" id="search-li">
21+
<input type="text" id="search-input" onfocus="searchFocus()" onkeyup="searchUpdate()" placeholder="Quick Nav" onkeypress="this.onkeyup();" onpaste="this.onkeyup();" oninput="this.onkeyup();" />
22+
<div id="search-dropdown">
23+
<div class="search-results-container" id="search-results-docs">
24+
<h2>In docs</h2>
25+
<div data-content="docs-results">
26+
<div class="no-results-note">No results</div>
27+
</div>
28+
</div>
29+
30+
<div class="search-results-container" id="search-results-projects">
31+
<h2>In projects</h2>
32+
<div data-content="project-results">
33+
<div class="no-results-note">No results</div>
34+
</div>
35+
</div>
36+
37+
<div class="search-results-container" id="search-results-misc">
38+
<h2>In other pages</h2>
39+
<div data-content="misc-results">
40+
<div class="no-results-note">No results</div>
41+
</div>
42+
</div>
43+
</div>
44+
</li>
2045
<li class="right button">
2146
<a href="https://github.com/ev3dev/ev3dev/issues" title="Found a bug? Report it here.">Issues</a>
2247
</li>

_includes/title.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<img id="logo" src="https://avatars3.githubusercontent.com/u/6878323?s=140" />
55
</a>
66
<div id="titleHeader" class="clear">
7-
<h1>{{ page.title }}</h1>
8-
<p>{{ page.subtitle }}</p>
7+
<h1 id="pageTitle">{{ page.title }}</h1>
8+
<p id="pageSubtitle">{{ page.subtitle }}</p>
99
</div>
1010
</div>
1111
<hr class="clear">

_layouts/docs.html

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,7 @@
66
<a href="{{ site.github.repository_url }}/edit/master/{{ page.path }}">Edit on Github</a>
77
</div>
88
<div class="breadcrumbs">
9-
{% assign parent_dirs=page.url | replace_first: '/', '' | split: '/' %}
10-
{% assign link='/' %}
11-
{% for dir in parent_dirs %}
12-
{% if forloop.last %}
13-
{{ dir }}
14-
{% else %}
15-
{% assign link=link | append: dir | append: '/' %}
16-
<a href="{{ link }}">{{ dir }}</a> &gt;
17-
{% endif %}
18-
{% endfor %}
9+
{% include breadcrumbs.html %}
1910
</div>
2011
<hr />
2112

_layouts/page.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
<div class="wrapper">
1111
<section>
1212
{% include title.html %}
13-
{{ content }}
13+
<div id="mainContent">
14+
{{ content }}
15+
</div>
1416
</section>
1517
{% include footer.html %}
1618
</div>

_layouts/project.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
<div class="breadcrumbs">
66
<a href="{{ site.github.url }}/projects">&lt; Back to Projects Gallery</a>
77
</div>
8-
<div class="project-content-wrapper">
8+
<div class="content-wrapper-for-sidebar">
99
{% include youtube-embed.html %}
1010
{{ content }}
1111
</div>
12-
<div class="project-sidebar">
12+
<div class="page-sidebar">
1313
<h3>
1414
Project Info
1515
</h3>

docs/getting-started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Getting Started with ev3dev
3+
categories: docs getting-started
34
---
45

56
* Table of Contents

javascripts/jquery.loadTemplate-1.4.4.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)