Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some favicon issues #49

Merged
merged 8 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,16 @@ sphinx_ansible_theme
A reusable Ansible Sphinx Theme.

Demo-site at https://sphinx-ansible-theme.readthedocs.io/en/latest/

Logos in ``sphinx_ansible_theme/static/images/``
felixfontein marked this conversation as resolved.
Show resolved Hide resolved
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The Ansible logos are taken from `the official Ansible Community logo download page <https://www.ansible.com/logos>`_. The files are slightly modified as follows:

* The SVG logos' bounding boxes are modified from ``0 0 300 300`` to ``30 30 240 240``.
* The PNG files are rescaled to 180x180 using ImageMagick as follows:

.. code-block:: sh

convert Ansible-Mark-Large-RGB-Black.png -resize 180x180 Ansible-Mark-RGB_Black.png
convert Ansible-Mark-Large-RGB-White.png -resize 180x180 Ansible-Mark-RGB_White.png
5 changes: 3 additions & 2 deletions sphinx_ansible_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
#}
{%-
set ansible_logo_url = logo_url
or ('_static/' + (logo or 'images/Ansible-Mark-RGB_White.svg'))
or ('_static/' + (logo or 'images/Ansible-Mark-RGB_White.png'))
%}
{%- set logo_url = '' %}{# Reset to prevent render in the RTD theme #}
{%- set logo = logo_url %}
{%-
set favicon_url = favicon_url
or ('_static/' + (favicon or 'images/Ansible-Mark-RGB_Black.svg'))
or ('_static/' + (favicon or 'images/Ansible-Mark-RGB_Black.png'))
%}
{%- set favicon = favicon_url | replace('_static/', '', 1) %}
{%- set favicon_url = pathto(favicon_url, 1) if '//' not in favicon_url and not favicon_url.startswith('/') else favicon_url %}

{%- extends "sphinx_rtd_theme/layout.html" %}

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.