Skip to content

Commit 99028a2

Browse files
committedAug 29, 2016
Add slidemenu theme by Chris Warrick
1 parent 5ab7a58 commit 99028a2

12 files changed

+11576
-0
lines changed
 

‎v7/slidemenu/LICENSE

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Copyright © 2016, Chris Warrick.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are
6+
met:
7+
8+
1. Redistributions of source code must retain the above copyright
9+
notice, this list of conditions, and the following disclaimer.
10+
11+
2. Redistributions in binary form must reproduce the above copyright
12+
notice, this list of conditions, and the following disclaimer in the
13+
documentation and/or other materials provided with the distribution.
14+
15+
3. Neither the name of the author of this software nor the names of
16+
contributors to this software may be used to endorse or promote
17+
products derived from this software without specific prior written
18+
consent.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

‎v7/slidemenu/README.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
slidemenu theme for Nikola
2+
==========================
3+
4+
A minimalistic, responsive-ish theme for Nikola, based on the `base-jinja` theme, with a slide-out menu.
5+
6+
Customization
7+
-------------
8+
9+
You can customize the theme by creating a `custom.css` file (`files/assets/css/custom.css`). Copy-paste the `/* Color preferences */` section from the provided `slidemenu.css` file and choose your own color scheme. Make sure to change `THEME_COLOR` in `conf.py` to fit.
10+
11+
The theme defaults to the system font stack (taken from Bootstrap 4), but you can use your own fonts by editing CSS.
12+
13+
License
14+
-------
15+
16+
*This theme was originally created in January 2016 for a private project and is now being made available to the public, with some modifications.*
17+
18+
Copyright © 2016, [Chris Warrick](https://chriswarrick.com/).
19+
All rights reserved.
20+
21+
Redistribution and use in source and binary forms, with or without
22+
modification, are permitted provided that the following conditions are
23+
met:
24+
25+
1. Redistributions of source code must retain the above copyright
26+
notice, this list of conditions, and the following disclaimer.
27+
28+
2. Redistributions in binary form must reproduce the above copyright
29+
notice, this list of conditions, and the following disclaimer in the
30+
documentation and/or other materials provided with the distribution.
31+
32+
3. Neither the name of the author of this software nor the names of
33+
contributors to this software may be used to endorse or promote
34+
products derived from this software without specific prior written
35+
consent.
36+
37+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
38+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
39+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
40+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
41+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
43+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
44+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
45+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
46+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
47+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

‎v7/slidemenu/assets/css/slidemenu.css

+281
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,281 @@
1+
/* CSS for slidemenu
2+
* Copyright © 2016, Chris Warrick. All rights reserved.
3+
* License: 3-clause BSD
4+
*/
5+
6+
/* Color preferences */
7+
#header, nav#menu li.active a, nav#menu li a:hover, #menu-toggle,
8+
button.form-control, a.btn {
9+
background: #5670d4;
10+
}
11+
12+
.entry-title, .entry-title a {
13+
color: #5670d4;
14+
}
15+
16+
nav#menu li.group, ul.pager li a, input.form-control {
17+
border: 1px solid #5670d4;
18+
}
19+
20+
nav#menu, nav#menu li a, #menu-toggle.active {
21+
background: #ccf;
22+
}
23+
24+
#menu-toggle:focus, #menu-toggle:active {
25+
outline: none;
26+
color: #ccf;
27+
}
28+
29+
#menu-toggle.active:focus, #menu-toggle.active:active {
30+
color: #00c;
31+
}
32+
/* End of color preferences */
33+
34+
/* Display CSS */
35+
body {
36+
font-size: 11pt;
37+
margin: 0 auto;
38+
padding: 0;
39+
}
40+
41+
body, #menu-toggle, input.form-control, button.form-control, a.btn {
42+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
43+
}
44+
45+
#container {
46+
max-width: 1200px;
47+
margin-top: 0;
48+
}
49+
50+
@media (max-width: 840px) {
51+
body {
52+
margin-left: 20px;
53+
margin-right: 20px;
54+
}
55+
}
56+
57+
@media (min-width: 841px) and (max-width: 999px) {
58+
#container {
59+
max-width: 800px;
60+
}
61+
}
62+
63+
@media (min-width: 1000px) and (max-width: 1400px) {
64+
#container {
65+
max-width: 960px;
66+
}
67+
}
68+
69+
#header {
70+
margin-top: 0;
71+
text-align: center;
72+
min-height: 100px;
73+
border-bottom-left-radius: 30px;
74+
border-bottom-right-radius: 30px;
75+
box-shadow: #000 0px 0px 20px;
76+
}
77+
78+
#header #brand {
79+
margin: 0;
80+
padding: 0;
81+
}
82+
83+
#header #brand a {
84+
color: white;
85+
line-height: 100px;
86+
font-size: 60px;
87+
text-decoration: none;
88+
}
89+
90+
#footer {
91+
text-align: center;
92+
color: #555;
93+
}
94+
95+
table {
96+
margin: 0 auto;
97+
width: 95%;
98+
table-layout: fixed;
99+
border-spacing: 0;
100+
border-collapse: collapse;
101+
}
102+
103+
.table td, .table th {
104+
border: 1px solid #000;
105+
}
106+
107+
.table th {
108+
font-weight: bold;
109+
}
110+
111+
nav#menu {
112+
width: 300px;
113+
height: 100%;
114+
margin: 0;
115+
transition: all 1s ease;
116+
position: fixed;
117+
left: 0px;
118+
top: 0px;
119+
overflow: auto;
120+
box-shadow: #000 3px 3px 5px;
121+
}
122+
123+
nav#menu ul {
124+
list-style: none;
125+
padding: 0;
126+
margin: 0;
127+
}
128+
129+
nav#menu ul li {
130+
display: block;
131+
margin-right: 0;
132+
border-radius: 20px;
133+
}
134+
135+
nav#menu li a {
136+
margin: 0;
137+
width: 100%;
138+
text-decoration: none;
139+
display: block;
140+
height: 40px;
141+
line-height: 40px;
142+
border-radius: 20px;
143+
transition: all 0.3s ease;
144+
}
145+
146+
nav#menu li a {
147+
color: #000;
148+
}
149+
150+
nav#menu li.active a {
151+
color: white;
152+
}
153+
154+
nav#menu li a:hover {
155+
color: white;
156+
}
157+
158+
nav#menu li .group-header {
159+
height: 40px;
160+
font-weight: bold;
161+
text-transform: uppercase;
162+
}
163+
164+
nav#menu li.group {
165+
margin: 10px 0;
166+
}
167+
168+
nav#menu.hide {
169+
left: -300px;
170+
box-shadow: none;
171+
}
172+
173+
#menu-toggle {
174+
margin: 0;
175+
height: 40px;
176+
width: 100px;
177+
text-align: center;
178+
border: 0;
179+
color: white;
180+
border-bottom-right-radius: 20px;
181+
font-size: 20px;
182+
line-height: 30px;
183+
position: fixed;
184+
top: 0px;
185+
left: 0px;
186+
transition: all 1s ease;
187+
box-shadow: #000 3px 3px 5px;
188+
z-index: 2;
189+
}
190+
191+
#menu-toggle.active {
192+
color: #000;
193+
left: 300px;
194+
}
195+
196+
.entry-title, .entry-title a {
197+
text-align: center;
198+
text-decoration: none;
199+
font-size: 20pt;
200+
}
201+
202+
ul.pager {
203+
display: block;
204+
list-style: none;
205+
padding: 0;
206+
text-align: center;
207+
}
208+
209+
ul.pager li {
210+
display: inline;
211+
margin: 0 15px;
212+
}
213+
214+
ul.pager li a {
215+
display: inline-block;
216+
border-radius: 12.5px;
217+
height: 25px;
218+
line-height: 25px;
219+
text-decoration: none;
220+
color: #000;
221+
padding: 0 10px;
222+
text-align: center;
223+
}
224+
225+
ul.pager .previous a:before {
226+
content: "« ";
227+
}
228+
229+
ul.pager .next a:after {
230+
content: " »";
231+
}
232+
233+
/* reset from base theme */
234+
.postindexpager .pager .next:before,
235+
.postindexpager .pager .previous:before,
236+
.postpromonav .pager .next:after,
237+
.postpromonav .pager .previous:before {
238+
content: "";
239+
}
240+
241+
.lead {
242+
font-size: 1.3em;
243+
}
244+
245+
input.form-control {
246+
font-size: 15px;
247+
line-height: 30px;
248+
margin-right: 10px;
249+
border-radius: 15px;
250+
padding: 5px;
251+
height: 20px;
252+
}
253+
254+
button.form-control, a.btn {
255+
border: 0;
256+
border-radius: 15px;
257+
height: 30px;
258+
color: white;
259+
display: inline-block;
260+
padding: 0 10px;
261+
font-size: 15px;
262+
line-height: 30px;
263+
}
264+
265+
button.form-control:hover, a.btn:hover {
266+
color: #ddd;
267+
}
268+
269+
pre.code {
270+
border: 1px solid #888;
271+
border-radius: 4px;
272+
padding: 15px;
273+
}
274+
275+
div.admonition, div.attention, div.caution, div.danger, div.error, div.hint, div.important, div.note, div.tip, div.warning, div.sidebar {
276+
border: 1px solid #888;
277+
}
278+
279+
div.admonition p.admonition-title, div.hint p.admonition-title, div.important p.admonition-title, div.note p.admonition-title, div.tip p.admonition-title, div.sidebar p.sidebar-title, div.attention p.admonition-title, div.caution p.admonition-title, div.danger p.admonition-title, div.error p.admonition-title, div.warning p.admonition-title {
280+
border-bottom: 1px solid #888;
281+
}

‎v7/slidemenu/assets/js/jquery.js

+11,008
Large diffs are not rendered by default.

‎v7/slidemenu/assets/js/jquery.min.js

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎v7/slidemenu/assets/js/jquery.min.map

+1
Large diffs are not rendered by default.

‎v7/slidemenu/assets/js/menu.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
$('#menu-toggle').click(function() {
2+
$('#menu').toggleClass('hide');
3+
$('#menu-toggle').toggleClass('active');
4+
});

‎v7/slidemenu/bundles

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
assets/css/all.css=rst.css,code.css,theme.css,slidemenu.css,custom.css
2+
assets/css/all-nocdn.css=rst.css,code.css,theme.css,slidemenu.css,custom.css

‎v7/slidemenu/engine

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
jinja

‎v7/slidemenu/parent

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
base-jinja
+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{# -*- coding: utf-8 -*- #}
2+
{% import 'base_helper.tmpl' as base with context %}
3+
4+
{% macro html_header() %}
5+
<header id="header">
6+
{{ html_site_title() }}
7+
{{ html_translation_header() }}
8+
{{ html_navigation_links() }}
9+
{% if search_form %}
10+
<div class="searchform" role="search">
11+
{{ search_form }}
12+
</div>
13+
{% endif %}
14+
</header>
15+
{{ template_hooks['page_header']() }}
16+
{% endmacro %}
17+
18+
{% macro html_site_title() %}
19+
<h1 id="brand"><a href="{{ abs_link(_link("root", None, lang)) }}" title="{{ blog_title|e }}" rel="home">
20+
{% if logo_url %}
21+
<img src="{{ logo_url }}" alt="{{ blog_title|e }}" id="logo">
22+
{% endif %}
23+
24+
{% if show_blog_title %}
25+
<span id="blog-title">{{ blog_title|e }}</span>
26+
{% endif %}
27+
</a></h1>
28+
<button type="button" id="menu-toggle">Menu</button>
29+
{% endmacro %}
30+
31+
{% macro html_navigation_links() %}
32+
<nav id="menu" class="hide">
33+
<ul>
34+
{% for url, text in navigation_links[lang] %}
35+
{% if isinstance(url, tuple) %}
36+
<li class="group"><span class="group-header">{{ text }}</span>
37+
<ul>
38+
{% for suburl, text in url %}
39+
{% if rel_link(permalink, suburl) == "#" %}
40+
<li class="active"><a href="{{ permalink }}">{{ text }} <span class="sr-only">{{ messages("(active)", lang) }}</span></a></li>
41+
{% else %}
42+
<li><a href="{{ suburl }}">{{ text }}</a></li>
43+
{% endif %}
44+
{% endfor %}
45+
</ul>
46+
</li>
47+
{% else %}
48+
{% if rel_link(permalink, url) == "#" %}
49+
<li class="active"><a href="{{ permalink }}">{{ text }} <span class="sr-only">{{ messages("(active)", lang) }}</span></a></li>
50+
{% else %}
51+
<li><a href="{{ url }}">{{ text }}</a></li>
52+
{% endif %}
53+
{% endif %}
54+
{% endfor %}
55+
{{ template_hooks['menu']() }}
56+
{{ template_hooks['menu_alt']() }}
57+
</ul>
58+
</nav>
59+
{% endmacro %}
60+
61+
{% macro html_translation_header() %}
62+
{% if translations|length > 1 %}
63+
<div id="toptranslations">
64+
<h2>{{ messages("Languages:") }}</h2>
65+
{{ base.html_translations() }}
66+
</div>
67+
{% endif %}
68+
{% endmacro %}
+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
{# -*- coding: utf-8 -*- #}
2+
3+
{% macro html_headstart() %}
4+
<!DOCTYPE html>
5+
<html \
6+
prefix='
7+
{% if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']) %}
8+
og: http://ogp.me/ns# article: http://ogp.me/ns/article#
9+
{% endif %}
10+
{% if comment_system == 'facebook' %}
11+
fb: http://ogp.me/ns/fb#
12+
{% endif %}
13+
' \
14+
{% if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']) %}
15+
vocab="http://ogp.me/ns" \
16+
{% endif %}
17+
{% if is_rtl %}
18+
dir="rtl"
19+
{% endif %}
20+
21+
lang="{{ lang }}">
22+
<head>
23+
<meta charset="utf-8">
24+
{% if use_base_tag %}
25+
<base href="{{ abs_link(permalink) }}">
26+
{% endif %}
27+
{% if description %}
28+
<meta name="description" content="{{ description|e }}">
29+
{% endif %}
30+
<meta name="viewport" content="width=device-width">
31+
{% if title == blog_title %}
32+
<title>{{ blog_title|e }}</title>
33+
{% else %}
34+
<title>{{ title|e }} | {{ blog_title|e }}</title>
35+
{% endif %}
36+
37+
{{ html_stylesheets() }}
38+
<meta content="{{ theme_color }}" name="theme-color">
39+
{{ html_feedlinks() }}
40+
<link rel="canonical" href="{{ abs_link(permalink) }}">
41+
42+
{% if favicons %}
43+
{% for name, file, size in favicons %}
44+
<link rel="{{ name }}" href="{{ file }}" sizes="{{ size }}"/>
45+
{% endfor %}
46+
{% endif %}
47+
48+
{% if comment_system == 'facebook' %}
49+
<meta property="fb:app_id" content="{{ comment_system_id }}">
50+
{% endif %}
51+
52+
{% if prevlink %}
53+
<link rel="prev" href="{{ prevlink }}" type="text/html">
54+
{% endif %}
55+
{% if nextlink %}
56+
<link rel="next" href="{{ nextlink }}" type="text/html">
57+
{% endif %}
58+
59+
{{ mathjax_config }}
60+
{% if use_cdn %}
61+
<!--[if lt IE 9]><script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
62+
{% else %}
63+
<!--[if lt IE 9]><script src="{{ url_replacer(permalink, '/assets/js/html5.js', lang) }}"></script><![endif]-->
64+
{% endif %}
65+
<script src="/assets/js/jquery.min.js"></script>
66+
67+
{{ extra_head_data }}
68+
{% endmacro %}
69+
70+
{% macro late_load_js() %}
71+
<script src="/assets/js/menu.js"></script>
72+
{{ social_buttons_code }}
73+
{% endmacro %}
74+
75+
{% macro html_stylesheets() %}
76+
{% if use_bundles %}
77+
{% if use_cdn %}
78+
<link href="/assets/css/all.css" rel="stylesheet" type="text/css">
79+
{% else %}
80+
<link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css">
81+
{% endif %}
82+
{% else %}
83+
<link href="/assets/css/rst.css" rel="stylesheet" type="text/css">
84+
<link href="/assets/css/code.css" rel="stylesheet" type="text/css">
85+
<link href="/assets/css/theme.css" rel="stylesheet" type="text/css">
86+
<link href="/assets/css/slidemenu.css" rel="stylesheet" type="text/css">
87+
{% if has_custom_css %}
88+
<link href="/assets/css/custom.css" rel="stylesheet" type="text/css">
89+
{% endif %}
90+
{% endif %}
91+
{% if needs_ipython_css %}
92+
<link href="/assets/css/ipython.min.css" rel="stylesheet" type="text/css">
93+
<link href="/assets/css/nikola_ipython.css" rel="stylesheet" type="text/css">
94+
{% endif %}
95+
{% endmacro %}
96+
97+
{% macro html_feedlinks() %}
98+
{% if rss_link %}
99+
{{ rss_link }}
100+
{% elif generate_rss %}
101+
{% if translations|length > 1 %}
102+
{% for language in translations|sort %}
103+
<link rel="alternate" type="application/rss+xml" title="RSS ({{ language }})" href="{{ _link('rss', None, language) }}">
104+
{% endfor %}
105+
{% else %}
106+
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ _link('rss', None) }}">
107+
{% endif %}
108+
{% endif %}
109+
{% if generate_atom %}
110+
{% if translations|length > 1 %}
111+
{% for language in translations|sort %}
112+
<link rel="alternate" type="application/atom+xml" title="Atom ({{ language }})" href="{{ _link('index_atom', None, language) }}">
113+
{% endfor %}
114+
{% else %}
115+
<link rel="alternate" type="application/atom+xml" title="Atom" href="{{ _link('index_atom', None) }}">
116+
{% endif %}
117+
{% endif %}
118+
{% endmacro %}
119+
120+
{% macro html_translations() %}
121+
<ul class="translations">
122+
{% for langname in translations|sort %}
123+
{% if langname != lang %}
124+
<li><a href="{{ abs_link(_link("root", None, langname)) }}" rel="alternate" hreflang="{{ langname }}">{{ messages("LANGUAGE", langname) }}</a></li>
125+
{% endif %}
126+
{% endfor %}
127+
</ul>
128+
{% endmacro %}

0 commit comments

Comments
 (0)
Please sign in to comment.