Skip to content

Commit 1619b60

Browse files
authored
[PR-23855] pack of improvements and fixes (#365)
**1. Redirect cases extension** New case handler has been added `/path/page.html?q=1` --> `/path/page/?q=1` Read nginx's `default.conf` comment for full list of cases **2. Navbar burger button fix** The PyData theme, which is used as the basis for the Book theme starting from v0.16, introduced the bug with the navbar burger button. The Pydata version has been downgraded to 0.15.4 See for more details pydata/pydata-sphinx-theme#2067 **3. Add a hidden title to the main page** No H1 title on the main page caused `<no title>` value in title meta tag and <no title> name in navigation URL at the bottom of the second page Fixed by adding the title but hiding it with styles **4. requirements.txt cleanup** Leftover packages clean up
1 parent e5046cf commit 1619b60

File tree

5 files changed

+41
-39
lines changed

5 files changed

+41
-39
lines changed

nginx/conf.d/default.conf

+19-26
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,6 @@ server {
3030
absolute_redirect off;
3131
port_in_redirect on;
3232

33-
# Rewrite .html → no .html
34-
location ~* ^/.+\.html$ {
35-
# Avoid redirect loops if this is an internal sub-request (fallback)
36-
if ($uri != $request_uri) {
37-
break;
38-
}
39-
40-
# If it ends with "index.html", remove "index.html"
41-
# e.g. /path/index.html => /path/
42-
# e.g. /index.html => /
43-
rewrite "^/(.*)index\.html$" /$1 permanent;
44-
45-
# Otherwise remove ".html" and append slash
46-
# e.g. /overview.html => /overview/
47-
rewrite "^/(.+)\.html$" /$1/ permanent;
48-
}
49-
5033
# Serve static assets with long cache
5134
location ~* \.(?:css|js|jpe?g|png|gif|ico|svg|woff2?|ttf|eot|otf|webp)$ {
5235
expires 1y;
@@ -55,23 +38,33 @@ server {
5538
try_files $uri =404;
5639
}
5740

58-
# Redirect requests starting with /search/?q=& to /
59-
# Fix of the Furo theme bug described here https://talkable.atlassian.net/browse/PR-23789
60-
# location /search/ {
61-
# if ($arg_q = "") {
62-
# return 301 /;
63-
# }
64-
# }
65-
6641
# Serve robots.txt from a specific file
6742
location = /robots.txt {
6843
alias /var/www/robots.txt;
6944
access_log off;
7045
log_not_found off;
7146
}
7247

73-
# Default static-file behavior
7448
location / {
49+
50+
# Handle requests where the user explicitly requests an "index" page,
51+
# with or without the ".html" extension. It removes the "index" part from the URL.
52+
# For example:
53+
# /index.html → /
54+
# /index → /
55+
# /folder/index.html?q=1 → /folder/?q=1
56+
if ($request_uri ~ ^(.*/)?index(?:\.html)?(?:\?(.*))?$) {
57+
return 301 $1$is_args$args;
58+
}
59+
60+
# Strip the ".html" extension and append a trailing slash.
61+
# For example:
62+
# /about.html → /about/
63+
# /folder/page.html?q=1 → /folder/page/?q=1
64+
if ($request_uri ~ ^(.+)\.html(?:\?(.*))?$) {
65+
return 301 $1/$is_args$args;
66+
}
67+
7568
try_files $uri $uri/ =404;
7669
}
7770
}

packages.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@
55
sphinx-copybutton
66
sphinx-sitemap
77
sphinx-autobuild
8-
sphinx-book-theme
98
sphinx-design
9+
10+
sphinx-book-theme
11+
pydata-sphinx-theme==0.15.4
12+
# The Book theme version has been hardcoded due to an navbar issue starting from PyData v0.16.
13+
# For more details, see https://github.com/pydata/pydata-sphinx-theme/issues/2067.
14+
# Please ensure the issue has been resolved before updating the version.

requirements.txt

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
11
accessible-pygments==0.0.5
22
alabaster==1.0.0
33
anyio==4.8.0
4-
babel==2.16.0
5-
beautifulsoup4==4.12.3
6-
certifi==2024.12.14
4+
babel==2.17.0
5+
beautifulsoup4==4.13.3
6+
certifi==2025.1.31
77
charset-normalizer==3.4.1
88
click==8.1.8
99
colorama==0.4.6
1010
docutils==0.21.2
11-
furo==2024.8.6
1211
h11==0.14.0
1312
idna==3.10
1413
imagesize==1.4.1
1514
Jinja2==3.1.5
1615
MarkupSafe==3.0.2
1716
packaging==24.2
18-
pydata-sphinx-theme==0.16.1
17+
pydata-sphinx-theme==0.15.4
1918
Pygments==2.19.1
2019
requests==2.32.3
2120
sniffio==1.3.1
2221
snowballstemmer==2.2.0
2322
soupsieve==2.6
2423
Sphinx==8.1.3
2524
sphinx-autobuild==2024.10.3
26-
sphinx-basic-ng==1.0.0b2
2725
sphinx-book-theme==1.1.3
2826
sphinx-copybutton==0.5.2
29-
sphinx-favicon==1.0.1
3027
sphinx-sitemap==2.6.0
3128
sphinx_design==0.6.1
3229
sphinxcontrib-applehelp==2.0.0

source/_templates/layout.html

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
{# Set the title and sitename divider to '|' and hide 'no title' if the page has no title #}
44
{% block htmltitle %}
5-
{% if title == "&lt;no title&gt;" %}
6-
<title>{{ docstitle|e }}</title>
7-
{% else %}
8-
<title>{{ title|striptags|e }} | {{ docstitle|e }}</title>
9-
{% endif %}
5+
<title>{{ title|striptags|e }} | {{ docstitle|e }}</title>
106
{% endblock %}
117

128
{# Google Tag Manager injection #}

source/index.rst

+11
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@
88
.. meta::
99
:description: Talkable campaigns, features and integration docs for referral program launch and settings.
1010

11+
.. raw:: html
12+
13+
<div style="visibility: hidden; height: 0; overflow: hidden;">
14+
15+
Main
16+
====
17+
18+
.. raw:: html
19+
20+
</div>
21+
1122
.. grid:: 1 2 2 2
1223

1324
.. grid-item::

0 commit comments

Comments
 (0)