diff --git a/CHANGES.rst b/CHANGES.rst index 61a1285..55a2a1c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,26 @@ +Version 1.1.4 +============= + +Released 2019-01-28 + +- Store a page's canonical URL in + ``html_context["page_canonical_url"]`` rather than overwriting + ``canonical_url``, for compatibility with Read the Docs. (`#21`_) + +.. _#21: https://github.com/pallets/pallets-sphinx-themes/pull/21 + + +Version 1.1.3 +============= + +Released 2019-01-28 + +- Move the Read the Docs search flag to the ``footer`` block to ensure + it executes after Read the Docs injects its data. (`#20`_) + +.. _#20: https://github.com/pallets/pallets-sphinx-themes/pull/20 + + Version 1.1.2 ============= diff --git a/LICENSE.rst b/LICENSE.rst index 6a2ee7d..c37cae4 100644 --- a/LICENSE.rst +++ b/LICENSE.rst @@ -1,39 +1,28 @@ -`BSD 3-Clause `_ - -Copyright © 2014 by the Pallets team. - -Some rights reserved. +Copyright 2007 Pallets Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -- Redistributions of source code must retain the above copyright +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -- Neither the name of the copyright holder nor the names of its +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. -We kindly ask you to use these themes in an unmodified manner only with -Pallets and Pallets-related projects, not for unrelated projects. If you -like the visual style and want to use it for your own projects, please -consider making some larger changes to the themes (such as changing font -faces, sizes, colors or margins). - -THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND -CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/MANIFEST.in b/MANIFEST.in index cd63c3a..d9f22be 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ -include CHANGES.rst LICENSE.rst +include CHANGES.rst +include LICENSE.rst graft src/pallets_sphinx_themes global-exclude *.py[co] diff --git a/PKG-INFO b/PKG-INFO index becab2f..55d5ba2 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,11 +1,11 @@ Metadata-Version: 1.1 Name: Pallets-Sphinx-Themes -Version: 1.1.2 +Version: 1.1.4 Summary: Sphinx themes for Pallets and related projects. Home-page: https://github.com/pallets/pallets-sphinx-themes/ -Author: The Pallets Team +Author: Pallets Author-email: contact@palletsprojects.com -License: BSD +License: BSD-3-Clause Description: Pallets Sphinx Themes ===================== diff --git a/setup.py b/setup.py index b3b4a1d..4fce04d 100644 --- a/setup.py +++ b/setup.py @@ -8,10 +8,10 @@ setup( name="Pallets-Sphinx-Themes", - version="1.1.2", + version="1.1.4", url="https://github.com/pallets/pallets-sphinx-themes/", - license="BSD", - author="The Pallets Team", + license="BSD-3-Clause", + author="Pallets", author_email="contact@palletsprojects.com", description="Sphinx themes for Pallets and related projects.", long_description=readme, @@ -19,7 +19,7 @@ package_dir={"": "src"}, include_package_data=True, zip_safe=False, - install_requires=["sphinx", "packaging"], + install_requires=["Sphinx", "packaging"], entry_points={ "pygments.styles": [ "pocoo = pallets_sphinx_themes.themes.pocoo:PocooStyle", diff --git a/src/Pallets_Sphinx_Themes.egg-info/PKG-INFO b/src/Pallets_Sphinx_Themes.egg-info/PKG-INFO index becab2f..55d5ba2 100644 --- a/src/Pallets_Sphinx_Themes.egg-info/PKG-INFO +++ b/src/Pallets_Sphinx_Themes.egg-info/PKG-INFO @@ -1,11 +1,11 @@ Metadata-Version: 1.1 Name: Pallets-Sphinx-Themes -Version: 1.1.2 +Version: 1.1.4 Summary: Sphinx themes for Pallets and related projects. Home-page: https://github.com/pallets/pallets-sphinx-themes/ -Author: The Pallets Team +Author: Pallets Author-email: contact@palletsprojects.com -License: BSD +License: BSD-3-Clause Description: Pallets Sphinx Themes ===================== diff --git a/src/Pallets_Sphinx_Themes.egg-info/requires.txt b/src/Pallets_Sphinx_Themes.egg-info/requires.txt index fba28fb..d451952 100644 --- a/src/Pallets_Sphinx_Themes.egg-info/requires.txt +++ b/src/Pallets_Sphinx_Themes.egg-info/requires.txt @@ -1,2 +1,2 @@ -sphinx +Sphinx packaging diff --git a/src/pallets_sphinx_themes/__init__.py b/src/pallets_sphinx_themes/__init__.py index 6eaff81..e359780 100644 --- a/src/pallets_sphinx_themes/__init__.py +++ b/src/pallets_sphinx_themes/__init__.py @@ -64,7 +64,8 @@ def canonical_url(app, pagename, templatename, context, doctree): """Build the canonical URL for a page. Appends the path for the page to the base URL specified by the - ``html_context["canonical_url"]`` config. + ``html_context["canonical_url"]`` config and stores it in + ``html_context["page_canonical_url"]``. """ base = context.get("canonical_url") @@ -72,7 +73,7 @@ return target = app.builder.get_target_uri(pagename) - context["canonical_url"] = base + target + context["page_canonical_url"] = base + target @only_pallets_theme() diff --git a/src/pallets_sphinx_themes/themes/babel/static/babel.css b/src/pallets_sphinx_themes/themes/babel/static/babel.css index 6841512..35e4cc9 100644 --- a/src/pallets_sphinx_themes/themes/babel/static/babel.css +++ b/src/pallets_sphinx_themes/themes/babel/static/babel.css @@ -18,7 +18,7 @@ pre, * pre { padding: 7px 0 7px 30px!important; margin: 15px 0!important; line-height: 1.3; } - + /* colors */ div.body { color: #3E4349; } a { color: #5D2CD1; } diff --git a/src/pallets_sphinx_themes/themes/pocoo/layout.html b/src/pallets_sphinx_themes/themes/pocoo/layout.html index b9833a8..e132e05 100644 --- a/src/pallets_sphinx_themes/themes/pocoo/layout.html +++ b/src/pallets_sphinx_themes/themes/pocoo/layout.html @@ -6,20 +6,10 @@ {%- endset %} {% block extrahead %} - {%- if canonical_url %} - + {%- if page_canonical_url %} + {%- endif %} - {%- if READTHEDOCS and not readthedocs_docsearch %} - - {%- endif %} {{ super() }} {%- endblock %} @@ -44,3 +34,17 @@ {{- super() }} {%- endblock %} + +{% block footer %} + {{ super() }} + {%- if READTHEDOCS and not readthedocs_docsearch %} + + {%- endif %} +{% endblock %}