layout.html 5.7 KB

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