From c7bc43f3dbf90dd7f3169f4d9ee2692b1fa480f4 Mon Sep 17 00:00:00 2001 From: en-ver Date: Wed, 5 Feb 2025 14:12:39 +0300 Subject: [PATCH 1/6] remove leftover packages --- requirements.txt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 59857e70..1c7965e4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,13 @@ 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 @@ -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 From 726e7ac1f2c912fbfc5b0cef93b254758e4f2705 Mon Sep 17 00:00:00 2001 From: en-ver Date: Wed, 5 Feb 2025 14:14:14 +0300 Subject: [PATCH 2/6] add the hidden title to make it shown in meta tags and pages naviagtion (left arrow in the bottom of the next page after main) but not shown in main page --- source/index.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) 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:: From a77158c29003bf8fd32eb5b46633ba6db5fa1519 Mon Sep 17 00:00:00 2001 From: en-ver Date: Wed, 5 Feb 2025 14:15:16 +0300 Subject: [PATCH 3/6] remove teh title hack since it's not needed anymore after the hiddent title usage implementation --- source/_templates/layout.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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 #} From e0212750b0b027c7fac5a0328235b27286b2a16d Mon Sep 17 00:00:00 2001 From: en-ver Date: Wed, 5 Feb 2025 17:46:37 +0300 Subject: [PATCH 4/6] handle corner case redirect for backward compatibility /path/page.html?q=1 to be redirected to /path/page/?q=1 --- nginx/conf.d/default.conf | 45 +++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 26 deletions(-) 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; } } From bcf3ee839124247aa1224606f54aca71f8cad95d Mon Sep 17 00:00:00 2001 From: en-ver Date: Wed, 5 Feb 2025 17:48:07 +0300 Subject: [PATCH 5/6] navbar burger menu incorrect bahaviour fix https://github.com/pydata/pydata-sphinx-theme/issues/2067 revert the version of PyData Theme to 0.15.4 --- packages.txt | 8 +++++++- requirements.txt | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages.txt b/packages.txt index 47025416..e937d52f 100644 --- a/packages.txt +++ b/packages.txt @@ -5,5 +5,11 @@ sphinx-copybutton sphinx-sitemap sphinx-autobuild -sphinx-book-theme sphinx-design + +# sphinx-book-theme +pydata-sphinx-theme==0.15.4 +# Book theme version has been hardcoded due to the navbar issue starting from PyData v0.16 +# Read more here https://github.com/pydata/pydata-sphinx-theme/issues/2067 +# Please make sure the issue has been fixed before bumping teh version + diff --git a/requirements.txt b/requirements.txt index 1c7965e4..18306ab8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ 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 From 99ed611f44a66e5a26bc90d41c2014a4e2fec480 Mon Sep 17 00:00:00 2001 From: en-ver Date: Wed, 5 Feb 2025 18:56:15 +0300 Subject: [PATCH 6/6] Typos fixes --- packages.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages.txt b/packages.txt index e937d52f..2aec488f 100644 --- a/packages.txt +++ b/packages.txt @@ -7,9 +7,8 @@ sphinx-sitemap sphinx-autobuild sphinx-design -# sphinx-book-theme +sphinx-book-theme pydata-sphinx-theme==0.15.4 -# Book theme version has been hardcoded due to the navbar issue starting from PyData v0.16 -# Read more here https://github.com/pydata/pydata-sphinx-theme/issues/2067 -# Please make sure the issue has been fixed before bumping teh version - +# 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.