diff --git a/CHANGES b/CHANGES index 28aec456c18..2e5fd60ea1b 100644 --- a/CHANGES +++ b/CHANGES @@ -18,6 +18,7 @@ Features added * #6707: C++, support bit-fields. * #267: html: Eliminate prompt characters of doctest block from copyable text +* #6729: html theme: agogo theme now supports ``rightsidebar`` option Bugs fixed ---------- diff --git a/doc/usage/theming.rst b/doc/usage/theming.rst index e0d779b9954..3b42bc4cba5 100644 --- a/doc/usage/theming.rst +++ b/doc/usage/theming.rst @@ -237,6 +237,8 @@ These themes are: - **documentwidth** (CSS length): Width of the document (without sidebar), default 50em. - **sidebarwidth** (CSS length): Width of the sidebar, default 20em. + - **rightsidebar** (true or false): Put the sidebar on the right side. + Defaults to ``True``. - **bgcolor** (CSS color): Background color. - **headerbg** (CSS value for "background"): background for the header area, default a grayish gradient. diff --git a/sphinx/themes/agogo/layout.html b/sphinx/themes/agogo/layout.html index 1ab82f7f015..b4644020300 100644 --- a/sphinx/themes/agogo/layout.html +++ b/sphinx/themes/agogo/layout.html @@ -33,15 +33,7 @@ {% endblock %} -{% block content %} -
-
-
- {%- block document %} - {{ super() }} - {%- endblock %} -
- {%- endblock %} +{% endmacro %} + +{% block content %} +
+
+ {%- if not theme_rightsidebar|tobool %} + + {%- endif %} +
+ {%- block document %} + {{ super() }} + {%- endblock %} +
+ {%- if theme_rightsidebar|tobool %} + + {%- endif %}
diff --git a/sphinx/themes/agogo/static/agogo.css_t b/sphinx/themes/agogo/static/agogo.css_t index f8951421ebc..f7b2577193a 100644 --- a/sphinx/themes/agogo/static/agogo.css_t +++ b/sphinx/themes/agogo/static/agogo.css_t @@ -175,7 +175,11 @@ div.document { } div.body { + {%- if theme_rightsidebar|tobool %} padding-right: 2em; + {%- else %} + padding-left: 2em; + {% endif %} text-align: {{ theme_textalign }}; } @@ -270,7 +274,11 @@ div.document ol { div.sidebar { width: {{ theme_sidebarwidth|todim }}; + {%- if theme_rightsidebar|tobool %} float: right; + {%- else %} + float: left; + {%- endif %} font-size: .9em; } diff --git a/sphinx/themes/agogo/theme.conf b/sphinx/themes/agogo/theme.conf index 28f6b040a85..6a4457e95d1 100644 --- a/sphinx/themes/agogo/theme.conf +++ b/sphinx/themes/agogo/theme.conf @@ -8,6 +8,7 @@ bodyfont = "Verdana", Arial, sans-serif headerfont = "Georgia", "Times New Roman", serif pagewidth = 70em documentwidth = 50em +rightsidebar = true sidebarwidth = 20em bgcolor = #eeeeec headerbg = #555573 url(bgtop.png) top left repeat-x