summaryrefslogtreecommitdiff
path: root/_exts/taler_sphinx_theme/guzzle_sphinx_theme/layout.html
blob: 72a08de36f1085c5cba2e21e0d5a15fbe368dc40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
{%- extends "basic/layout.html" %}

{# Do this so that bootstrap is included before the main css file #}
{%- block htmltitle %}
  {% set script_files = script_files + ["_static/myscript.js"] %}
  <!-- Licensed under the Apache 2.0 License -->
  <link rel="stylesheet" type="text/css" href="{{ pathto('_static/fonts/open-sans/stylesheet.css', 1) }}" />
  <!-- Licensed under the SIL Open Font License -->
  <link rel="stylesheet" type="text/css" href="{{ pathto('_static/fonts/source-serif-pro/source-serif-pro.css', 1) }}" />
  <link rel="stylesheet" type="text/css" href="{{ pathto('_static/css/bootstrap.min.css', 1) }}" />
  <link rel="stylesheet" type="text/css" href="{{ pathto('_static/css/bootstrap-theme.min.css', 1) }}" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  {{ super() }}
{%- endblock %}

{%- block extrahead %}
  {% if theme_touch_icon %}
  <link rel="apple-touch-icon" href="{{ pathto('_static/' ~ theme_touch_icon, 1) }}" />
  {% endif %}
  {{ super() }}
{% endblock %}

{# Displays the URL for the homepage if it's set or the master_doc if it is not #}
{% macro homepage() -%}
  {%- if theme_homepage %}
    {%- if hasdoc(theme_homepage) %}
      {{ pathto(theme_homepage) }}
    {%- else %}
      {{ theme_homepage }}
    {%- endif %}
  {%- else %}
    {{ pathto(master_doc) }}
  {%- endif %}
{%- endmacro %}

{# Displays the URL for the tospage if it's set or falls back to homepage macro #}
{% macro tospage() -%}
  {%- if theme_tospage %}
    {%- if hasdoc(theme_tospage) %}
      {{ pathto(theme_tospage) }}
    {%- else %}
      {{ theme_tospage }}
    {%- endif %}
  {%- else %}
    {{ homepage() }}
  {%- endif %}
{%- endmacro %}

{# Displays the URL for the projectpage if it's set or falls back to homepage macro #}
{% macro projectlink() -%}
  {%- if theme_projectlink %}
    {%- if hasdoc(theme_projectlink) %}
      {{ pathto(theme_projectlink) }}
    {%- else %}
      {{ theme_projectlink }}
    {%- endif %}
  {%- else %}
    {{ homepage() }}
  {%- endif %}
{%- endmacro %}

{# Displays the next and previous links both before and after content #}
{% macro render_relations() -%}
  {% if prev or next %}
  <div class="footer-relations">
    {% if prev %}
      <div class="pull-left">
        <a class="btn btn-default" href="{{ prev.link|e }}" title="{{ _('previous chapter')}} (use the left arrow)">{{ prev.title }}</a>
      </div>
    {% endif %}
    {%- if next and next.title != '&lt;no title&gt;' %}
      <div class="pull-right">
        <a class="btn btn-default" href="{{ next.link|e }}" title="{{ _('next chapter')}} (use the right arrow)">{{ next.title }}</a>
      </div>
    {%- endif %}
    </div>
    <div class="clearer"></div>
  {% endif %}
{%- endmacro %}

{%- macro guzzle_sidebar() %}
  <div id="left-column">
    <div class="sphinxsidebar">
      {%- if sidebars != None %}
        {#- new style sidebar: explicitly include/exclude templates #}
        {%- for sidebartemplate in sidebars %}
        {%- include sidebartemplate %}
        {%- endfor %}
      {% else %}
        {% include "logo-text.html" %}
        {% include "globaltoc.html" %}
        {% include "searchbox.html" %}
      {%- endif %}
    </div>
  </div>
{%- endmacro %}

{%- block content %}

  {%- if pagename == 'index' and theme_index_template %}
    {% include theme_index_template %}
  {%- else %}
    <div class="container-wrapper">

      <div id="mobile-toggle">
        <a href="#"><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span></a>
      </div>

      {%- block sidebar1 %}{{ guzzle_sidebar() }}{% endblock %}

      {%- block document_wrapper %}
        {%- block document %}
        <div id="right-column">
          {% block breadcrumbs %}
          <div role="navigation" aria-label="breadcrumbs navigation">
            <ol class="breadcrumb">
              <li><a href="{{ pathto(master_doc) }}">Docs</a></li>
              {% for doc in parents %}
                <li><a href="{{ doc.link|e }}">{{ doc.title }}</a></li>
              {% endfor %}
              <li>{{ title }}</li>
            </ol>
          </div>
          {% endblock %}
          <div class="document clearer body" role="main">
            {% block body %} {% endblock %}
          </div>
          {%- block bottom_rel_links %}
            {{ render_relations() }}
          {%- endblock %}
        </div>
        <div class="clearfix"></div>
        {%- endblock %}
      {%- endblock %}

      {%- block comments -%}
        {% if theme_disqus_comments_shortname %}
        <div class="container comment-container">
          {% include "comments.html" %}
        </div>
        {% endif %}
      {%- endblock %}
    </div>
  {%- endif %}
  {%- endblock %}

{%- block footer %}
<script type="text/javascript">
  $("#mobile-toggle a").click(function () {
    $("#left-column").toggle();
  });
</script>
<script type="text/javascript" src="{{ pathto('_static/js/bootstrap.js', 1)}}"></script>
{%- block footer_wrapper %}
  <div class="footer">
    &copy; Copyright {{ copyright }}. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
  </div>
{%- endblock %}
{%- block ga %}
  {%- if theme_google_analytics_account %}
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', '{{ theme_google_analytics_account }}']);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    </script>
  {%- endif %}
{%- endblock %}
{%- endblock %}