Skip to content

Commit 666fdfd

Browse files
authored
Fix for Sphinx 7.0.0 (#11)
1 parent 768ec1d commit 666fdfd

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""Setup TLCPack."""
33
from setuptools import setup, find_packages
44

5-
__version__ = "0.2.2"
5+
__version__ = "0.2.3"
66

77

88
setup(

tlcpack_sphinx_addon/_templates/layout.html

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
{%- set sphinx_writer = 'writer-html5' if html5_doctype else 'writer-html4' %}
1919
{% set theme_asset_url = theme_asset_url | default(pathto('_static/',1 )) %}
2020

21+
{%- set (_ver_major, _ver_minor) = (sphinx_version.split('.') | list)[:2] | map('int') -%}
22+
{%- set sphinx_version_info = (_ver_major, _ver_minor, -1) -%}
23+
2124
<!DOCTYPE html>
2225
<html class="{{ sphinx_writer }}" lang="{{ lang_attr }}" >
2326
<head>
@@ -30,7 +33,9 @@
3033

3134
{# CSS #}
3235
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
33-
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
36+
{%- if sphinx_version_info < (4, 0) -%}
37+
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
38+
{%- endif %}
3439
{%- for css in css_files %}
3540
{%- if css|attr("rel") %}
3641
<link rel="{{ css.rel }}" href="{{ pathto(css.filename, 1) }}" type="text/css"{% if css.title is not none %} title="{{ css.title }}"{% endif %} />
@@ -158,7 +163,7 @@
158163
{% for version in version_prefixes %}
159164
{% set version_url = "/" if version == "main" else version %}
160165
{% set version_desc = nav_version + " (main)" if version == "main" else version.strip("/") %}
161-
166+
162167
<li><div class="version"><a style="font-size: 0.8em; padding: 4px" href="{{ version_url }}">{{ version_desc }}</a></div></li>
163168
{% endfor %}
164169
</ol>

0 commit comments

Comments
 (0)