layout.html (5724B)
1 {%- extends "basic/layout.html" %} 2 3 {# Do this so that bootstrap is included before the main css file #} 4 {%- block htmltitle %} 5 <!-- Licensed under the Apache 2.0 License --> 6 <link rel="stylesheet" type="text/css" href="{{ pathto('_static/fonts/open-sans/stylesheet.css', 1) }}" /> 7 <!-- Licensed under the SIL Open Font License --> 8 <link rel="stylesheet" type="text/css" href="{{ pathto('_static/fonts/source-serif-pro/source-serif-pro.css', 1) }}" /> 9 <link rel="stylesheet" type="text/css" href="{{ pathto('_static/css/bootstrap.min.css', 1) }}" /> 10 <link rel="stylesheet" type="text/css" href="{{ pathto('_static/css/bootstrap-theme.min.css', 1) }}" /> 11 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 12 {{ super() }} 13 {%- endblock %} 14 15 {%- block extrahead %} 16 {% if theme_touch_icon %} 17 <link rel="apple-touch-icon" href="{{ pathto('_static/' ~ theme_touch_icon, 1) }}" /> 18 {% endif %} 19 {{ super() }} 20 {% endblock %} 21 22 {# Displays the URL for the homepage if it's set or the master_doc if it is not #} 23 {% macro homepage() -%} 24 {%- if theme_homepage %} 25 {%- if hasdoc(theme_homepage) %} 26 {{ pathto(theme_homepage) }} 27 {%- else %} 28 {{ theme_homepage }} 29 {%- endif %} 30 {%- else %} 31 {{ pathto(master_doc) }} 32 {%- endif %} 33 {%- endmacro %} 34 35 {# Displays the URL for the tospage if it's set or falls back to homepage macro #} 36 {% macro tospage() -%} 37 {%- if theme_tospage %} 38 {%- if hasdoc(theme_tospage) %} 39 {{ pathto(theme_tospage) }} 40 {%- else %} 41 {{ theme_tospage }} 42 {%- endif %} 43 {%- else %} 44 {{ homepage() }} 45 {%- endif %} 46 {%- endmacro %} 47 48 {# Displays the URL for the projectpage if it's set or falls back to homepage macro #} 49 {% macro projectlink() -%} 50 {%- if theme_projectlink %} 51 {%- if hasdoc(theme_projectlink) %} 52 {{ pathto(theme_projectlink) }} 53 {%- else %} 54 {{ theme_projectlink }} 55 {%- endif %} 56 {%- else %} 57 {{ homepage() }} 58 {%- endif %} 59 {%- endmacro %} 60 61 {# Displays the next and previous links both before and after content #} 62 {% macro render_relations() -%} 63 {% if prev or next %} 64 <div class="footer-relations"> 65 {% if prev %} 66 <div class="pull-left"> 67 <a class="btn btn-default" href="{{ prev.link|e }}" title="{{ _('previous chapter')}} (use the left arrow)">{{ prev.title }}</a> 68 </div> 69 {% endif %} 70 {%- if next and next.title != '<no title>' %} 71 <div class="pull-right"> 72 <a class="btn btn-default" href="{{ next.link|e }}" title="{{ _('next chapter')}} (use the right arrow)">{{ next.title }}</a> 73 </div> 74 {%- endif %} 75 </div> 76 <div class="clearer"></div> 77 {% endif %} 78 {%- endmacro %} 79 80 {%- macro guzzle_sidebar() %} 81 <div id="left-column"> 82 <div class="sphinxsidebar"> 83 {%- if sidebars != None %} 84 {#- new style sidebar: explicitly include/exclude templates #} 85 {%- for sidebartemplate in sidebars %} 86 {%- include sidebartemplate %} 87 {%- endfor %} 88 {% else %} 89 {% include "logo-text.html" %} 90 {% include "globaltoc.html" %} 91 {% include "searchbox.html" %} 92 {%- endif %} 93 </div> 94 </div> 95 {%- endmacro %} 96 97 {%- block content %} 98 99 {%- if pagename == 'index' and theme_index_template %} 100 {% include theme_index_template %} 101 {%- else %} 102 <div class="container-wrapper"> 103 104 <div id="mobile-toggle"> 105 <a href="#"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span></a> 106 </div> 107 108 {%- block sidebar1 %}{{ guzzle_sidebar() }}{% endblock %} 109 110 {%- block document_wrapper %} 111 {%- block document %} 112 <div id="right-column"> 113 {% block breadcrumbs %} 114 <div role="navigation" aria-label="breadcrumbs navigation"> 115 <ol class="breadcrumb"> 116 <li><a href="{{ pathto(master_doc) }}">Docs</a></li> 117 {% for doc in parents %} 118 <li><a href="{{ doc.link|e }}">{{ doc.title }}</a></li> 119 {% endfor %} 120 <li>{{ title }}</li> 121 </ol> 122 </div> 123 {% endblock %} 124 <div class="document clearer body" role="main"> 125 {% block body %} {% endblock %} 126 </div> 127 {%- block bottom_rel_links %} 128 {{ render_relations() }} 129 {%- endblock %} 130 </div> 131 <div class="clearfix"></div> 132 {%- endblock %} 133 {%- endblock %} 134 135 {%- block comments -%} 136 {% if theme_disqus_comments_shortname %} 137 <div class="container comment-container"> 138 {% include "comments.html" %} 139 </div> 140 {% endif %} 141 {%- endblock %} 142 </div> 143 {%- endif %} 144 {%- endblock %} 145 146 {%- block footer %} 147 <script type="text/javascript"> 148 $("#mobile-toggle a").click(function () { 149 $("#left-column").toggle(); 150 }); 151 </script> 152 <script type="text/javascript" src="{{ pathto('_static/js/bootstrap.js', 1)}}"></script> 153 {%- block footer_wrapper %} 154 <div class="footer"> 155 © Copyright {{ copyright }}. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>. 156 </div> 157 {%- endblock %} 158 {%- block ga %} 159 {%- if theme_google_analytics_account %} 160 <script type="text/javascript"> 161 var _gaq = _gaq || []; 162 _gaq.push(['_setAccount', '{{ theme_google_analytics_account }}']); 163 _gaq.push(['_trackPageview']); 164 (function() { 165 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; 166 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 167 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); 168 })(); 169 </script> 170 {%- endif %} 171 {%- endblock %} 172 {%- endblock %}