Skip to content

Commit 0a5edea

Browse files
authored
Merge pull request just-the-docs#19 from pmarsceill/task-lists
Task lists
2 parents 4b8e051 + 32b708c commit 0a5edea

File tree

17 files changed

+182
-15
lines changed

17 files changed

+182
-15
lines changed

_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ baseurl: "/just-the-docs/" # the subpath of your site, e.g. /blog
2121
permalink: pretty
2222
exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "package.json", "script/", "LICENSE.txt", "lib/", "bin/", "README.md", "Rakefile"]
2323

24+
# Enable or disable the site search
25+
search_enabled: true
26+
2427
# Aux links for the upper right navigation
2528
aux_links:
2629
"Just the Docs on GitHub":

_includes/head.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
<title>{{ page.title }} - {{ site.title }}</title>
66
<link rel="stylesheet" href="{{ "/assets/css/just-the-docs.css" | absolute_url }}">
7+
{% if site.search_enabled != nil %}
78
<script type="text/javascript" src="{{ "/assets/js/vendor/lunr.min.js" | absolute_url }}"></script>
9+
{% endif %}
810
<script type="text/javascript" src="{{ "/assets/js/just-the-docs.js" | absolute_url }}"></script>
911

1012
<meta name="viewport" content="width=device-width, initial-scale=1">

_layouts/default.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@
1616
</div>
1717
<div class="main-content-wrap">
1818
<div class="page-header">
19-
<div class="main-content pb-0">
19+
<div class="main-content">
20+
{% if site.search_enabled != nil %}
2021
<div class="search js-search">
2122
<div class="search-input-wrap">
2223
<input type="text" class="js-search-input search-input" placeholder="Search {{ site.title }}" aria-label="Search {{ site.title }}" autocomplete="off">
2324
<svg width="14" height="14" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg" class="search-icon"><title>Search</title><g fill-rule="nonzero"><path d="M17.332 20.735c-5.537 0-10-4.6-10-10.247 0-5.646 4.463-10.247 10-10.247 5.536 0 10 4.601 10 10.247s-4.464 10.247-10 10.247zm0-4c3.3 0 6-2.783 6-6.247 0-3.463-2.7-6.247-6-6.247s-6 2.784-6 6.247c0 3.464 2.7 6.247 6 6.247z"/><path d="M11.672 13.791L.192 25.271 3.02 28.1 14.5 16.62z"/></g></svg>
2425
</div>
2526
<div class="js-search-results search-results-wrap"></div>
2627
</div>
28+
{% endif %}
2729
{% if site.aux_links != nil %}
28-
<ul class="list-style-none text-small mt-md-2 pb-4 pb-md-0 js-aux-nav aux-nav">
30+
<ul class="list-style-none text-small mt-md-1 mb-md-1 pb-4 pb-md-0 js-aux-nav aux-nav">
2931
{% for link in site.aux_links %}
3032
<li class="d-inline-block my-0{% unless forloop.last %} mr-2{% endunless %}"><a href="{{ link.last }}">{{ link.first }}</a></li>
3133
{% endfor %}

_sass/content.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,23 @@
5656
}
5757
}
5858

59+
.task-list {
60+
padding-left: 0;
61+
}
62+
63+
.task-list-item {
64+
display: flex;
65+
align-items: center;
66+
67+
&::before {
68+
content: "";
69+
}
70+
}
71+
72+
.task-list-item-checkbox {
73+
margin-right: 0.6em;
74+
}
75+
5976
hr + * {
6077
margin-top: 0;
6178
}

_sass/layout.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,18 @@
7979

8080
@include mq(md) {
8181
background-color: $white;
82-
border-bottom: $border $border-color;
83-
8482
}
8583

8684
.main-content {
8785
padding-top: 0;
8886

8987
@include mq(md) {
9088
display: flex;
91-
justify-content: space-between;
89+
justify-content: flex-end;
90+
height: 60px;
9291
padding-top: $sp-4;
92+
padding-bottom: $sp-4;
93+
border-bottom: $border $border-color;
9394
}
9495
}
9596
}

_sass/navigation.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
z-index: 101;
1515
height: 60px;
1616
padding-top: $sp-4;
17-
box-shadow: inset 0 -1px 0 $border-color;
17+
border-bottom: $border $border-color;
1818
}
1919
}
2020

_sass/search.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
display: block;
1818
padding-top: $sp-1;
1919
padding-right: 0;
20-
padding-bottom: $sp-4;
20+
padding-bottom: 0;
2121
padding-left: 0;
2222
margin-bottom: 0;
2323
background-color: transparent;

assets/js/just-the-docs.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ function initSearch() {
155155

156156
function ready(){
157157
toggleNav();
158-
initSearch();
158+
if (typeof lunr !== 'undefined') {
159+
initSearch();
160+
}
159161
}
160162

161163
// in case the document is already rendered

docs/configuration.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
layout: default
3+
title: Configuration
4+
nav_order: 2
5+
---
6+
7+
# Configuration
8+
9+
Just the Docs has some specific configuration parameters that can be definied in your Jekyll site's `config.yml` file.
10+
11+
## Search enabled
12+
13+
```yml
14+
# Enable or disable the site search
15+
search_enabled: true
16+
```
17+
18+
## Aux links
19+
20+
```yml
21+
# Aux links for the upper right navigation
22+
aux_links:
23+
"Just the Docs on GitHub":
24+
- "//github.com/pmarsceill/just-the-docs"
25+
```

docs/customization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: default
33
title: Customization
4-
nav_order: 5
4+
nav_order: 6
55
---
66

77
# Customization

0 commit comments

Comments
 (0)