Skip to content

Commit e37b2dc

Browse files
flynnduismslack
authored andcommitted
docs(styles): tidy up JS, better affix the sidebar menu
1 parent a77d967 commit e37b2dc

39 files changed

Lines changed: 1474 additions & 3688 deletions

mkdocs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ markdown_extensions:
8686
- toc:
8787
permalink: True
8888
extra_javascript:
89+
- static/js/foundation.js
90+
- static/js/foundation.offcanvas.js
91+
- static/js/headroom.min.js
8992
- static/js/adjustments.js
90-
- static/js/bootstrap.min.js
91-
- static/js/checkURL.js
9293
google_analytics: ['UA-42867143-1', 'deis.io']

themes/deis/base.html

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@
1515
<meta name="msvalidate.01" content="08598E7D936D9217891AE6C1665A645D" />
1616

1717
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>
18-
<!-- <base href="https://deis.com/docs"> -->
1918

19+
<script type="text/javascript">var documentationBaseURL = "{{ base_url}}"</script>
2020
<link rel="icon" href="{{ base_url }}/static/img/favicon/favicon.png" type="image/png">
21-
22-
<!-- styles -->
2321
<link rel="stylesheet" href="{{ base_url }}/static/css/styles.css" type="text/css">
2422
</head>
2523

@@ -29,6 +27,7 @@
2927
<![endif]-->
3028

3129
{%- include "topbar.html" %}
30+
{%- include "offcanvas.html" %}
3231

3332
<!-- banner at the top of the page for temporary announcements-->
3433
<div data-alert class="alert-box alert banner text-center">
@@ -49,7 +48,9 @@
4948

5049
<nav class="sidebar">
5150
<div class="sidebar-inner">
52-
<ul class="current">
51+
<h1><a href="/" class="logo"><img src="{{ base_url }}/static/img/svg/logo.svg" width="128px" height="41px" alt="Deis"></a></h1>
52+
53+
<ul class="current sidebar-main">
5354
{%- include "nav.html" %}
5455
<li class="toctree-l1">
5556
{% if READTHEDOCS %}
@@ -78,28 +79,13 @@
7879

7980
{%- include "footer.html" %}
8081

81-
<!-- scripts -->
82-
<script type="text/javascript">var documentationBaseURL = "{{ base_url}}"</script>
83-
<script src="{{ base_url }}/static/js/modernizr-2.6.2-respond-1.1.0.min.js"></script>
84-
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
85-
<script>window.jQuery || document.write('<script src="{{ base_url }}/static/js/jquery-1.10.2.min.js"><\/script>')</script>
86-
87-
<!--
88-
extra_javascript contains paths to JavaScript files in the
89-
users documentation directory or a list of JavaScript files
90-
defined in their mkdocs.yml.
91-
92-
http://www.mkdocs.org/user-guide/configuration/#extra_javascript
93-
-->
82+
<!-- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> -->
83+
<script>window.jQuery || document.write('<script src="{{ base_url }}/static/js/jquery-1.12.4.min.js"><\/script>')</script>
84+
<!-- extra_javascript - defined in the root 'mkdocs.yml -->
9485
{% for path in extra_javascript %}
95-
<script src="{{ path }}"></script>
86+
<script src="{{ path }}" async></script>
9687
{% endfor %}
9788

98-
<!--
99-
Include Google Analytics tracking code.
100-
101-
http://www.mkdocs.org/user-guide/configuration/#google_analytics
102-
-->
10389
{% if google_analytics %}
10490
<script>
10591
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){

themes/deis/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</form>
2323
</div>
2424

25-
<script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script><script type='text/javascript'>(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';}(jQuery));var $mcj = jQuery.noConflict(true);</script>
25+
<script type='text/javascript' src='{{ base_url }}/static/js/mc-validate.js'></script><script type='text/javascript'>(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';}(jQuery));var $mcj = jQuery.noConflict(true);</script>
2626
<!--End mc_embed_signup-->
2727

2828
</div>

themes/deis/offcanvas.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<aside class="right-off-canvas-menu">
2+
<ul>
3+
<li>
4+
<a href="/how-it-works" id="m-header-hiw" class="item" title="How It Works">How It Works</a>
5+
</li>
6+
<li>
7+
<a href="/why-deis" id="m-header-why-deis" class="item" title="Why Use Deis">Why Use Deis</a>
8+
</li>
9+
<li>
10+
<a href="/services" id="m-header-services" class="item" title="Support &amp; Services">Support &amp; Services</a>
11+
</li>
12+
<li>
13+
<a href="/community" id="m-header-community" class="item" title="Community">Community</a>
14+
</li>
15+
<li>
16+
<a href="/blog" id="m-header-blog" class="item" title="Blog">Blog</a>
17+
</li>
18+
<li>
19+
<a href="https://github.com/deis/workflow" data-event-category="Get Started" data-event-action="click" class="item button expand" title="Get Started">Get Started</a>
20+
</li>
21+
</ul>
22+
</aside>

themes/deis/static/css/styles.css

Lines changed: 13 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

themes/deis/static/css/styles.css.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,26 @@
1-
$(function(){
2-
var pageHeight;
1+
$(document).ready(function() {
32

4-
function set_columns() {
5-
pageHeight = 0;
6-
$('footer').css('margin-top', '0');
7-
$('.nav-border').css('height', '600');
8-
pageHeight = $(document).height();
9-
// console.log(pageHeight);
10-
$('.nav-border').css('height', pageHeight);
3+
// init foundation for offcanvas menu
4+
$(document).foundation();
115

12-
var margin = pageHeight - 511 - 158;
13-
if (pageHeight < 800){
14-
margin = 270;
15-
$('body').css('height', '930');
16-
$('.nav-border').css('height', '930');
17-
}
18-
$('footer').css('margin-top', margin);
19-
$('footer').css('display', 'block');
20-
21-
if($(window).width() > 1171){$('.docs-sidebar').css({'position': 'absolute', 'right': '0'})};
22-
if($(window).width() < 1171){$('.docs-sidebar').css('position', 'static');}
23-
}
246

25-
//This variable checks if all accordions are closed. Used to ensure styling for Releases & FAQ page.
7+
// custom theme js for sidebar links
268
var allClosed;
279

28-
//Close all accordions, besides the menu containing the page that you've clicked on.
10+
// close all accordions, besides the menu containing the page that you've clicked on.
2911
$('.toctree-l1').each(function(){
3012
if($(this).children('a').attr('state') == 'open') {
3113
$(this).children('ul').show();
32-
set_columns();
3314
allClosed = false;
3415
return false;
3516
} else {
3617
allClosed = true;
3718
}
3819
});
3920

40-
if (allClosed == true) {set_columns();}
21+
if (allClosed == true) { }
4122

42-
43-
//If menu is closed when clicked, expand it
23+
// if menu is closed when clicked, expand it
4424
$('.toctree-l1 > a').click(function() {
4525

4626
//Make the titles of open accordions dead links
@@ -51,14 +31,33 @@ $(function(){
5131
$('.toctree-l1 > ul').hide();
5232
$('.toctree-l1 > a').attr('state', '');
5333
$(this).attr('state', 'open');
54-
$(this).next().slideDown(function(){set_columns();});
34+
$(this).next().slideDown(function(){});
5535
return false;
5636
}
5737
});
5838

59-
$('#AWS').attr('href', documentationBaseURL + '/quickstart/provider/aws/boot/')
60-
$('#GKE').attr('href', documentationBaseURL + '/quickstart/provider/gke/boot/')
61-
$('#Vagrant').attr('href', documentationBaseURL + '/quickstart/provider/vagrant/boot/')
6239

63-
$(window).resize(set_columns);
40+
// insert urls into markdown
41+
$(function(){
42+
$('#AWS').attr('href', documentationBaseURL + '/quickstart/provider/aws/boot/')
43+
$('#GKE').attr('href', documentationBaseURL + '/quickstart/provider/gke/boot/')
44+
$('#Vagrant').attr('href', documentationBaseURL + '/quickstart/provider/vagrant/boot/')
45+
});
46+
6447
});
48+
49+
50+
// use headroom.js for sticky topbar
51+
(function() {
52+
var searchBar = document.querySelector(".top-bar");
53+
new Headroom(searchBar, {
54+
offset: 50,
55+
classes: {
56+
"initial": "headroom",
57+
"pinned": "headroom--pinned",
58+
"unpinned": "headroom--unpinned",
59+
"top" : "headroom--top",
60+
"notTop" : "headroom--not-top"
61+
}
62+
}).init();
63+
}());

themes/deis/static/js/bootstrap.min.js

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

themes/deis/static/js/checkURL.js

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

0 commit comments

Comments
 (0)