diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-23 14:39:09 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-23 14:39:09 +0300 |
commit | 65a69965a1dba7e8f61caf53d3d8a9251eab4e19 (patch) | |
tree | b808cf2428ff06c7e6d19d3322b54e5722c97fd3 /sphinx/themes | |
parent | 3f5fc6278c6aef3dbb967d721c92b7618f5bd126 (diff) |
html theme: Add `favicon_url` and `logo_url`
To embed the external favicon and logo image, this adds new template
variable `favicon_url` and `logo_url` that point the external URL or
relative path for the favicon/logo file from current file. It helps to
use it on template files.
Diffstat (limited to 'sphinx/themes')
-rw-r--r-- | sphinx/themes/agogo/layout.html | 4 | ||||
-rw-r--r-- | sphinx/themes/basic/layout.html | 8 | ||||
-rw-r--r-- | sphinx/themes/basic/opensearch.xml | 4 | ||||
-rw-r--r-- | sphinx/themes/haiku/layout.html | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/sphinx/themes/agogo/layout.html b/sphinx/themes/agogo/layout.html index cd9ff8d20..2e472cd9c 100644 --- a/sphinx/themes/agogo/layout.html +++ b/sphinx/themes/agogo/layout.html @@ -13,9 +13,9 @@ {% block header %} <div class="header-wrapper" role="banner"> <div class="header"> - {%- if logo %} + {%- if logo_url %} <p class="logo"><a href="{{ pathto(master_doc)|e }}"> - <img class="logo" src="{{ pathto(logo, 1)|e }}" alt="Logo"/> + <img class="logo" src="{{ logo_url|e }}" alt="Logo"/> </a></p> {%- endif %} {%- block headertitle %} diff --git a/sphinx/themes/basic/layout.html b/sphinx/themes/basic/layout.html index 347ac2cc6..fd217b143 100644 --- a/sphinx/themes/basic/layout.html +++ b/sphinx/themes/basic/layout.html @@ -53,9 +53,9 @@ <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> {%- block sidebarlogo %} - {%- if logo %} + {%- if logo_url %} <p class="logo"><a href="{{ pathto(master_doc)|e }}"> - <img class="logo" src="{{ pathto(logo, 1)|e }}" alt="Logo"/> + <img class="logo" src="{{ logo_url|e }}" alt="Logo"/> </a></p> {%- endif %} {%- endblock %} @@ -140,8 +140,8 @@ title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}" href="{{ pathto('_static/opensearch.xml', 1) }}"/> {%- endif %} - {%- if favicon %} - <link rel="shortcut icon" href="{{ pathto(favicon, 1)|e }}"/> + {%- if favicon_url %} + <link rel="shortcut icon" href="{{ favicon_url|e }}"/> {%- endif %} {%- endif %} {%- block linktags %} diff --git a/sphinx/themes/basic/opensearch.xml b/sphinx/themes/basic/opensearch.xml index ad6273e44..ca7bb5966 100644 --- a/sphinx/themes/basic/opensearch.xml +++ b/sphinx/themes/basic/opensearch.xml @@ -6,8 +6,8 @@ <Url type="text/html" method="get" template="{{ use_opensearch }}/{{ pathto('search') }}?q={searchTerms}"/> <LongName>{{ docstitle|e }}</LongName> -{%- if favicon %} - <Image height="16" width="16" type="image/x-icon">{{ use_opensearch }}/{{ pathto(favicon, 1)|e }}</Image> +{%- if favicon_url %} + <Image height="16" width="16" type="image/x-icon">{{ use_opensearch }}/{{ favicon_url|e }}</Image> {%- endif %} {% block extra %} {# Put e.g. an <Image> element here. #} {% endblock %} </OpenSearchDescription> diff --git a/sphinx/themes/haiku/layout.html b/sphinx/themes/haiku/layout.html index 07f801007..06930504d 100644 --- a/sphinx/themes/haiku/layout.html +++ b/sphinx/themes/haiku/layout.html @@ -36,11 +36,11 @@ {%- block haikuheader %} {%- if theme_full_logo != "false" %} <a href="{{ pathto('index') }}"> - <img class="logo" src="{{ pathto(logo, 1)|e }}" alt="Logo"/> + <img class="logo" src="{{ logo_url|e }}" alt="Logo"/> </a> {%- else %} {%- if logo -%} - <img class="rightlogo" src="{{ pathto(logo, 1)|e }}" alt="Logo"/> + <img class="rightlogo" src="{{ logo_url|e }}" alt="Logo"/> {%- endif -%} <h1 class="heading"><a href="{{ pathto('index') }}"> <span>{{ shorttitle|e }}</span></a></h1> |