Skip to content

Commit a902102

Browse files
committed
Update for MkDocs 1.0.
1 parent 86b0d5b commit a902102

13 files changed

Lines changed: 56 additions & 29 deletions

File tree

basic_theme/base.html

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,18 @@
1515
<title>{% if page.title %}{{ page.title }} - {% endif %}{{ config.site_name }}</title>
1616

1717
<!--
18-
Support custom favicon support.
19-
http://www.mkdocs.org/user-guide/configuration/#site_favicon
18+
Just add a favicon.ico image to the docs.
2019
-->
21-
{% if favicon %}
22-
<link rel="shortcut icon" href="{{ favicon }}">
23-
{% else %}
24-
<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">
25-
{% endif %}
20+
<link rel="shortcut icon" href="{{ "img/favicon.ico"|url }}">
21+
2622

2723
<!--
2824
You can include external assets of course, but be aware that it means the
2925
documentation may not work well offline.
3026
-->
3127
<link rel="stylesheet" href="https://yui-s.yahooapis.com/pure/0.6.0/pure-min.css">
3228

33-
<link rel="stylesheet" href="{{ base_url }}/css/theme.css">
29+
<link rel="stylesheet" href="{{ "css/theme.css"|url }}">
3430

3531
<!--
3632
extra_ess contains paths to CSS files in the users
@@ -39,16 +35,23 @@
3935
4036
http://www.mkdocs.org/user-guide/configuration/#extra_css
4137
-->
42-
{% for path in extra_css %}
43-
<link href="{{ path }}" rel="stylesheet">
38+
{% for path in config.extra_css %}
39+
<link href="{{ path|url }}" rel="stylesheet">
4440
{% endfor %}
4541

4642
<!--
4743
To include static assets from our theme, just add
4844
{{ base_url }} beforehand which will be the relative path to
4945
the root of the documentation.
5046
-->
51-
<script src="{{ base_url }}/js/theme.js"></script>
47+
<script
48+
src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
49+
integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E="
50+
crossorigin="anonymous"></script>
51+
<script src="{{ "js/theme.js"|url }}></script>
52+
53+
{% block extrahead %}
54+
{% endblock %}
5255

5356
<!--
5457
extra_javascript contains paths to JavaScript files in the
@@ -57,8 +60,8 @@
5760
5861
http://www.mkdocs.org/user-guide/configuration/#extra_javascript
5962
-->
60-
{% for path in extra_javascript %}
61-
<script src="{{ path }}"></script>
63+
{% for path in config.extra_javascript %}
64+
<script src="{{ path|url }}"></script>
6265
{% endfor %}
6366

6467
<!--
@@ -78,8 +81,6 @@
7881
</script>
7982
{% endif %}
8083

81-
{% block extrahead %}
82-
{% endblock %}
8384
</head>
8485

8586
<body>
@@ -123,7 +124,7 @@ <h2>Support for search</h2>
123124
action and methods match below.
124125
-->
125126
<div role="search">
126-
<form action="{{ base_url }}/search.html" method="get">
127+
<form action="{{ "search.html"|url }}" method="get">
127128
<input type="search" name="q" placeholder="Search docs" />
128129
</form>
129130
</div>
@@ -137,13 +138,13 @@ <h2>Next and previous links</h2>
137138
{% if page.next_page or page.previous_page %}
138139
<div>
139140
{% if page.previous_page %}
140-
<a href="{{ page.previous_page.url }}" title="{{ page.previous_page.title }}">&#8592; Previous Page</a>
141+
<a href="{{ page.previous_page.url|url }}" title="{{ page.previous_page.title }}">&#8592; Previous Page</a>
141142
{% else %}
142143
&#8592; Previous Page
143144
{% endif %}
144145
-
145146
{% if page.next_page %}
146-
<a href="{{ page.next_page.url }}" title="{{ page.next_page.title }}"/>Next Page &#8594;</a>
147+
<a href="{{ page.next_page.url|url }}" title="{{ page.next_page.title }}"/>Next Page &#8594;</a>
147148
{% else %}
148149
Next Page &#8594;
149150
{% endif %}
@@ -156,14 +157,10 @@ <h2>Link to the source</h2>
156157
<!--
157158
Support repo URL
158159
-->
159-
{% if config.repo_url %}
160-
{% if config.repo_name == 'GitHub' %}
161-
<a href="{{ config.repo_url }}"> Edit on GitHub</a>
162-
{% elif config.repo_name == 'Bitbucket' %}
163-
<a href="{{ config.repo_url }}"> Edit on BitBucket</a>
164-
{% else %}
165-
<a href="{{ config.repo_url }}"> Edit in Repository</a>
166-
{% endif %}
160+
{% if page and page.edit_url %}
161+
<a href="{{ page.edit_url }}">Edit on {{ config.repo_name }}</a>
162+
{% elif config.repo_url %}
163+
<a href="{{ config.repo_url }}">{{ config.repo_name }}</a>
167164
{% endif %}
168165

169166
<hr/>

basic_theme/nav.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-->
44
{% if not nav_item.children %}
55
<li {% if nav_item.active %}class="active"{% endif %}>
6-
<a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
6+
<a href="{{ nav_item.url|url }}">{{ nav_item.title }}</a>
77
</li>
88
{% else %}
99
<li>

basic_theme/search.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
{% block extrahead %}
44
<script>var base_url = '{{ base_url }}';</script>
5-
<script data-main="{{ base_url }}/mkdocs/js/search.js" src="{{ base_url }}/mkdocs/js/require.js"></script>
65
{% endblock %}
76

87
{% block content %}

docs/about/contributing.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
title: Contributing
3+
---
14
# Testing Page
25

36
See the [Home Page](/). All the other pages are for demonstration purposes

docs/about/license.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
title: License
3+
---
14
# Testing Page
25

36
See the [Home Page](/). All the other pages are for demonstration purposes

docs/about/release-notes/version-1.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
title: Version 1 Release Notes
3+
---
14
# Testing Page
25

36
See the [Home Page](/). All the other pages are for demonstration purposes

docs/about/release-notes/version-2.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
title: Version 2 Release Notes
3+
---
14
# Testing Page
25

36
See the [Home Page](/). All the other pages are for demonstration purposes

docs/user-guide/configuration.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
title: Configuration
3+
---
4+
15
# Testing Page
26

37
See the [Home Page](/). All the other pages are for demonstration purposes

docs/user-guide/custom-themes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
title: Custom Themes
3+
---
14
# Testing Page
25

36
See the [Home Page](/). All the other pages are for demonstration purposes

docs/user-guide/deploying-your-docs.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
title: Deploying Your Docs
3+
---
14
# Testing Page
25

36
See the [Home Page](/). All the other pages are for demonstration purposes

0 commit comments

Comments
 (0)