diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf index 6939578a..5d6cdfe0 100644 --- a/nginx/conf.d/default.conf +++ b/nginx/conf.d/default.conf @@ -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; @@ -55,14 +38,6 @@ 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; @@ -70,8 +45,26 @@ server { 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; } } diff --git a/packages.txt b/packages.txt index 47025416..2aec488f 100644 --- a/packages.txt +++ b/packages.txt @@ -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. diff --git a/requirements.txt b/requirements.txt index 59857e70..18306ab8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,21 +1,20 @@ 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 @@ -23,10 +22,8 @@ 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 diff --git a/source/_templates/layout.html b/source/_templates/layout.html index 4acdccc3..6e889441 100644 --- a/source/_templates/layout.html +++ b/source/_templates/layout.html @@ -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>" %} - {{ docstitle|e }} - {% else %} - {{ title|striptags|e }} | {{ docstitle|e }} - {% endif %} + {{ title|striptags|e }} | {{ docstitle|e }} {% endblock %} {# Google Tag Manager injection #} diff --git a/source/index.rst b/source/index.rst index a045235a..394e0d6c 100644 --- a/source/index.rst +++ b/source/index.rst @@ -8,6 +8,17 @@ .. meta:: :description: Talkable campaigns, features and integration docs for referral program launch and settings. +.. raw:: html + +
+ +Main +==== + +.. raw:: html + +
+ .. grid:: 1 2 2 2 .. grid-item::