Make root title customizable

The theme displays "OpenStack Docs:" in the title and "Docs home"
in the tooltip, which makes it hard to reuse for other websites
(including the governance website). This patch makes the root title
("OpenStack Docs" by default) configurable.

Change-Id: I4140f62a328debf81703cddd17dd6364b5eab479
This commit is contained in:
Thierry Carrez 2018-09-25 13:35:22 +02:00
parent 39e7704612
commit 034683f12d
4 changed files with 13 additions and 2 deletions

View File

@ -158,6 +158,16 @@ can be disabled with the ``display_badge`` html theme option::
# ...
}
If you are using this theme for something other than docs.openstack.org,
you can customize the root title ("OpenStack Docs") that appears in the
page title and the left arrow tooltip::
html_theme_options = {
# ...
"root_title": "OpenStack Governance",
# ...
}
External Link Helper
--------------------

View File

@ -3,7 +3,7 @@
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
{% block header %}{% endblock %}
<title>OpenStack Docs: {{ title|striptags }}</title>
<title>{{ root_title|striptags }}: {{ title|striptags }}</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

View File

@ -1,6 +1,6 @@
<div class="col-lg-3 col-md-4 col-sm-4 col-lg-pull-9 col-md-pull-8 col-sm-pull-8 docs-sidebar">
<div class="btn-group docs-sidebar-releases">
<button onclick="location.href='/'" class="btn docs-sidebar-home" data-toggle="tooltip" data-placement="top" title="Docs Home"><i class="fa fa-arrow-circle-o-left"></i></button>
<button onclick="location.href='/'" class="btn docs-sidebar-home" data-toggle="tooltip" data-placement="top" title="{{ root_title|striptags }} Home"><i class="fa fa-arrow-circle-o-left"></i></button>
{%- if theme_sidebar_dropdown == 'api_ref' %}
{% include 'sidebartoc_menu_apiref.html' %}

View File

@ -8,6 +8,7 @@ analytics_tracking_code = UA-17511903-1
sidebar_mode = toctree
display_badge = True
display_toc = True
root_title = OpenStack Docs
sidebar_dropdown = os_docs
show_other_versions = False
earliest_published_series = mitaka