Skip to content

[PR-23855] pack of improvements and fixes #365

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

Merged
merged 6 commits into from
Feb 5, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 19 additions & 26 deletions nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,6 @@ server {
absolute_redirect off;
port_in_redirect on;

# Rewrite .html → no .html
location ~* ^/.+\.html$ {
# Avoid redirect loops if this is an internal sub-request (fallback)
if ($uri != $request_uri) {
break;
}

# If it ends with "index.html", remove "index.html"
# e.g. /path/index.html => /path/
# e.g. /index.html => /
rewrite "^/(.*)index\.html$" /$1 permanent;

# Otherwise remove ".html" and append slash
# e.g. /overview.html => /overview/
rewrite "^/(.+)\.html$" /$1/ permanent;
}

# Serve static assets with long cache
location ~* \.(?:css|js|jpe?g|png|gif|ico|svg|woff2?|ttf|eot|otf|webp)$ {
expires 1y;
Expand All @@ -55,23 +38,33 @@ server {
try_files $uri =404;
}

# Redirect requests starting with /search/?q=& to /
# Fix of the Furo theme bug described here https://talkable.atlassian.net/browse/PR-23789
# location /search/ {
# if ($arg_q = "") {
# return 301 /;
# }
# }

# Serve robots.txt from a specific file
location = /robots.txt {
alias /var/www/robots.txt;
access_log off;
log_not_found off;
}

# Default static-file behavior
location / {

# Handle requests where the user explicitly requests an "index" page,
# with or without the ".html" extension. It removes the "index" part from the URL.
# For example:
# /index.html → /
# /index → /
# /folder/index.html?q=1 → /folder/?q=1
if ($request_uri ~ ^(.*/)?index(?:\.html)?(?:\?(.*))?$) {
return 301 $1$is_args$args;
}

# Strip the ".html" extension and append a trailing slash.
# For example:
# /about.html → /about/
# /folder/page.html?q=1 → /folder/page/?q=1
if ($request_uri ~ ^(.+)\.html(?:\?(.*))?$) {
return 301 $1/$is_args$args;
}

try_files $uri $uri/ =404;
}
}
7 changes: 6 additions & 1 deletion packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@
sphinx-copybutton
sphinx-sitemap
sphinx-autobuild
sphinx-book-theme
sphinx-design

sphinx-book-theme
pydata-sphinx-theme==0.15.4
# The Book theme version has been hardcoded due to an navbar issue starting from PyData v0.16.
# For more details, see https://github.com/pydata/pydata-sphinx-theme/issues/2067.
# Please ensure the issue has been resolved before updating the version.
11 changes: 4 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
accessible-pygments==0.0.5
alabaster==1.0.0
anyio==4.8.0
babel==2.16.0
beautifulsoup4==4.12.3
certifi==2024.12.14
babel==2.17.0
beautifulsoup4==4.13.3
certifi==2025.1.31
charset-normalizer==3.4.1
click==8.1.8
colorama==0.4.6
docutils==0.21.2
furo==2024.8.6
h11==0.14.0
idna==3.10
imagesize==1.4.1
Jinja2==3.1.5
MarkupSafe==3.0.2
packaging==24.2
pydata-sphinx-theme==0.16.1
pydata-sphinx-theme==0.15.4
Pygments==2.19.1
requests==2.32.3
sniffio==1.3.1
snowballstemmer==2.2.0
soupsieve==2.6
Sphinx==8.1.3
sphinx-autobuild==2024.10.3
sphinx-basic-ng==1.0.0b2
sphinx-book-theme==1.1.3
sphinx-copybutton==0.5.2
sphinx-favicon==1.0.1
sphinx-sitemap==2.6.0
sphinx_design==0.6.1
sphinxcontrib-applehelp==2.0.0
Expand Down
6 changes: 1 addition & 5 deletions source/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

{# Set the title and sitename divider to '|' and hide 'no title' if the page has no title #}
{% block htmltitle %}
{% if title == "<no title>" %}
<title>{{ docstitle|e }}</title>
{% else %}
<title>{{ title|striptags|e }} | {{ docstitle|e }}</title>
{% endif %}
<title>{{ title|striptags|e }} | {{ docstitle|e }}</title>
{% endblock %}

{# Google Tag Manager injection #}
Expand Down
11 changes: 11 additions & 0 deletions source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
.. meta::
:description: Talkable campaigns, features and integration docs for referral program launch and settings.

.. raw:: html

<div style="visibility: hidden; height: 0; overflow: hidden;">

Main
====

.. raw:: html

</div>

.. grid:: 1 2 2 2

.. grid-item::
Expand Down