Coder Social home page Coder Social logo

readthedocs / sphinx-notfound-page Goto Github PK

View Code? Open in Web Editor NEW
48.0 7.0 32.0 769 KB

Create a custom 404 page with absolute URLs hardcoded

Home Page: https://sphinx-notfound-page.readthedocs.io/

License: MIT License

Python 99.18% HTML 0.82%
sphinx 404 readthedocs notfound sphinx-extension

sphinx-notfound-page's Introduction

Build status Current PyPI version Documentation status Repository license

sphinx-notfound-page

Create a custom 404 page with absolute URLs hardcoded.

Installation

pip install sphinx-notfound-page

Configuration

Add this extension in your conf.py file as:

extensions = [
 # ... other extensions here

 'notfound.extension',
]

Documentation

Check out the full documentation at https://sphinx-notfound-page.readthedocs.io/

Thanks

Strongly based on @ericholscher's solution from readthedocs/readthedocs.org#353

sphinx-notfound-page's People

Contributors

acozine avatar agjohnson avatar agnieszkawierzbowska avatar atlinx avatar banesullivan avatar bobotig avatar daltz333 avatar dgarcia360 avatar dojutsu-user avatar drts01 avatar ericholscher avatar graingert avatar hugovk avatar humitos avatar huonw avatar jdillard avatar kianmeng avatar kloczek avatar melaniewalsh avatar methane avatar mitya57 avatar pyup-bot avatar rscohn2 avatar sbraz avatar stsewd avatar takos22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sphinx-notfound-page's Issues

Replace default lang and default version for prefix

I haven't read the code for the actual implementation, but feels like too specific to have notfound_default_language and notfound_default_version . Those can be replaced by notfound_default_prefix. And this would remove notfound_no_urls_prefix, because we can just set notfound_default_prefix = ''

Also, we are not in 1.0 yet, so we could break the api, or maybe we can just mark them as deprecated before removing them.

Tests: re-add tests for minor versions of Sphinx

When we migrated to Circle CI in #130 we removed tests for different Sphinx minor versions and we are only testing the latest on major ones. However, Sphinx has break compatibility between minor versions and there are things that work different. Example https://github.com/rtfd/sphinx-notfound-page/blob/f30850e4a648e4490824499671f72522e41c66fa/tests/test_urls.py#L406-L409

So, I want to bring back them. I prefer to break the code on CI than receive a user report.

Add tests

This needs some tests as well. At very least this should unit test the pathto method that is overridden. Integration tests are handy, but are harder to implement and can wait. See some of the tests inside Sphinx core for best practice here.

parallel read error

Parallel builds get an error:

(doc-venv) rscohn1@rscohn1-MOBL:sphinx-substitution-extensions$ make build-sample-parallel
rm -rf sample/build
+ rm -rf sample/build
sphinx-build -j 2 -W -b html sample/source sample/build
+ sphinx-build -j 2 -W -b html sample/source sample/build
Running Sphinx v3.2.1
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 6 source files that are out of date
updating environment: [new config] 6 added, 0 changed, 0 removed
reading sources... [ 50%] five .. index
reading sources... [100%] one .. two

waiting for workers...

Extension error:
Handler <bound method EnvironmentCollector.merge_other of <notfound.extension.OrphanMetadataCollector object at 0x7f7daddd1080>> for\
 event 'env-merge-info' threw an exception (exception: )
Makefile:34: recipe for target 'build-sample-parallel' failed
make: *** [build-sample-parallel] Error 2
(doc-venv) rscohn1@rscohn1-MOBL:sphinx-substitution-extensions$

The test doc has an index and 5 files which only have titles:

..

  This is a test of parallel document builds. You need at least 5
  documents. See:
  https://github.com/adamtheturtle/sphinx-substitution-extensions/pull/173

.. toctree::
   :hidden:

   one
   two
   three
   four
   five

The problem is here. I don't understand the issue, maybe it is a bug in sphinx.

The problem can avoided by declaring that the extension is not parallel read safe here. Or by not calling the orphan code. I will file an issue with sphinx.

Could not import extension notfound.extension (exception: No module named 'notfound')

It works locally following by

  1. Installation pip3 install sphinx-notfound-page
  2. Add this extension in the conf.py file as:
extensions = [
 'notfound.extension',
]
  1. Add configuration
    notfound_urls_prefix = None

But when build in Netlify - Sphinx / prose it returns error as following:

Could not import extension notfound.extension (exception: No module named 'notfound')
make: *** [Makefile:22: linkcheck] Error 2

Environment info
Python VENV
Python 3.9.12
Sphinx build version sphinx-build 4.3.2

Any advice? Thanks in advance.

Mention that simple local webservers often don't handle 404s by default

I don't know if it is worth mentioning in the docs somewhere, but http.server (and other simple webservers I'm sure) don't have a default handler for 404 codes, so people might run into issues when attempting to test out the extension locally.

I also don't know if the docs would need to go this far, but here is an example of adding a custom request handler for 404 codes: https://stackoverflow.com/questions/22467908/python-simplehttpserver-404-page

How do I use this?

How can I plug this into my existing docs? I pip installed this then tried adding it to the extensions in my conf.py:

$ make html
Running Sphinx v1.8.4

Extension error:
Could not import extension sphinx-notfound-page (exception: No module named 'sphinx-notfound-page')
make: *** [html] Error 2

Broken when deployed with GH Pages

We recently had to migrate the docs for vtki over to GitHub pages from readthedocs because we're now using the sphinx-gallery extension to create an epic examples page!

Unfortunately, readthedocs can't handle setting up all the dependencies we need to actually run vtki (or least it's not clear how we could do this). This means all the sphinx-notfound-page links are broken because the assume the en/latest phrase is prefixed to all pages.

For example check out this 404 page: http://docs.vtki.org/foo

Screen Shot 2019-04-05 at 12 59 33 PM

All the links in the sidebar go to 404 pages as well....

Error: 404 file "does not start with" the right directory

I'm trying to add a 404 page to my Jupyter Book, which uses Sphinx to build the book and allows you to add your own Sphinx extensions.

But I'm getting the following error when I try to build my Jupyter Book with the notfound.extension:

An error happened in rendering the page 404.
Reason: ValueError("'/en/latest' does not start with '/Volumes/MelData/Intro-Cultural-Analytics/book'")

The file path /Volumes/MelData/Intro-Cultural-Analytics/book is the path to my Jupyter Book, so it seems like there's an issue with the 404.html/en/latest file not being output to the correct directory? Is there a way of specifying where the 404 file should be output?

Setting configuration in conf.py

Is this the right way of setting the Configuration options in conf.py. I don't seems to get it working. As all my static assets are still pointing to default - /en/latest/

extensions = [
    'notfound.extension',
]

notfound_urls_prefix = 'None'

Thanks in advance.

Make each test case to be independent

Unfortunately, sphinx.Application does not support outdir attribute to pass a temporal file. Currently, each test is sharing the same output directory and this is not good.

It's not a problem (yet), since the file that we are testing is re-written completely, but files that are not used in the current test are not deleted. This could bring some issues hard to find in the future.

Sidebar links broken

On some pages, the TOC sidebar links do not work.

For example, go to this 404 page (which is an old link to this example) in one of my projects now using sphinx-notfound-page and try to go to the examples page. Note that only the Home link at the top works

ezgif com-video-to-gif

404.rst is built but not used

A custom 404.rst is put next to the other pages. The 404.html is generated but not used.

A dead link displays the default 404 page from the extensions config. "Page not found - thanks for trying".

Did I miss something?

Conf.py:

extensions = [
    'authorship',
    'sphinx.ext.extlinks',
    'notfound.extension',
]

notfound_no_urls_prefix = True

Thank you :)

Environment variable tests

We can use lazy fixtures for pytest, or parametrized fixtures to first set the environment variable and the second fixture makes the build.

There is a test commented out about this problem.

Prepend version but not language

Thank you for developing this extension!

It appears, however, that I can choose to omit only the combination of default language and version, but not either one.

My sphinx setup has just a version prefix. I currently have to set the default language to '.' to get a sensible result. It would be great if I could just set it to None (or just specify the whole prefix myself, as in #27, perhaps by allowing it to be specified as a template string).

Fails to build with Sphinx 3.4.3

Hello,

On Fedora we are testing the dependants of Sphinx whenever we update to a new version, and it seems that sphinx-notfound-page fails to build with this error message:

================================== FAILURES ===================================
__________________________ test_sphinx_resource_urls ___________________________

app = <SphinxTestApp buildername='html'>
status = <_io.StringIO object at 0x7fbf98785280>
warning = <_io.StringIO object at 0x7fbf98785700>

    @pytest.mark.sphinx(srcdir=srcdir)
    def test_sphinx_resource_urls(app, status, warning):
        app.build()
        path = app.outdir / '404.html'
        assert path.exists()
    
        content = open(path).read()
    
        chunks = [
            # Sphinx's resources URLs
            '<script type="text/javascript" src="/en/latest/_static/jquery.js"></script>',
            '<script type="text/javascript" src="/en/latest/_static/underscore.js"></script>',
            '<script type="text/javascript" src="/en/latest/_static/doctools.js"></script>',
        ]
    
        if sphinx.version_info >= (1, 8):
            chunks.append(
                '<script type="text/javascript" src="/en/latest/_static/language_data.js"></script>',
            )
    
        for chunk in chunks:
>           assert chunk in content
E           assert '<script type="text/javascript" src="/en/latest/_static/jquery.js"></script>' in '\n<!DOCTYPE html>\n\n<html>\n  <head>\n    <meta charset="utf-8" />\n    <meta name="viewport" content="width=device-..."https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>\n      \n    </div>\n\n    \n\n    \n  </body>\n</html>'

tests/test_urls.py:456: AssertionError

Add license to PyPI package

When running this command, it should show the proper license.

$ pip show sphinx-notfound-page
Name: sphinx-notfound-page
Version: 0.2.1
Summary: Sphinx extension to build a 404 page with absolute URLs
Home-page: https://github.com/rtfd/sphinx-notfound-page
Author: Manuel Kaufmann
Author-email: [email protected]
License: UNKNOWN
Location: /home/humitos/rtfd/code/sphinx-notfound-page
Requires: sphinx
Required-by: 
(readthedocs.org) 
$ 

Disabling prefix leads to "WARNING: The config value `notfound_urls_prefix' has type `NoneType', defaults to `str'."

Python version: 3.9.0
Sphinx version: 1.8.5
sphinx-notfound-page version: 0.6

Here's the relevant part of my conf.py:

# sphinx-notfound-page
# https://github.com/readthedocs/sphinx-notfound-page
notfound_context = {
    "title": "Page Not Found",
    "body": """
<h1>Page Not Found</h1>
<p>Sorry, we couldn"t find that page.</p>
<p>Try using the search box or go to the homepage.</p>
""",
}

# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
on_rtd = os.environ.get("READTHEDOCS", None) == "True"

# Don't add `/en/latest` prefix during local development.
# This makes it easier to test the custom 404 page by loading `/404.html`
# on a local web server.
if not on_rtd:
    notfound_urls_prefix = None

I've been able to avoid this by setting the value to '' (empty string) instead, but the documentation doesn't mention this. I guess we should just update the documentation to reflect this?

Resources are not loaded for the 404 page, leading to plain html page.

Hey all, I'm trying to copy Godot's sphinx setup and I'm using GitHub pages to host my docs. The 404 page loads successfully but it's a plain HTML page. Does anyone know what's causing this?

Untitled

Parts of my config file related to this extension:

extensions = [
    "myst_parser",
    "gdscript",
    "sphinx.ext.autodoc",
    "sphinx.ext.intersphinx",
    "sphinx.ext.viewcode",
    "sphinx_panels",
    "sphinx_tabs.tabs",
    "notfound.extension",
    "sphinxext.opengraph",
]

notfound_urls_prefix = ''

notfound_context = {
    "title": "Page not found",
    "body": """
        <h1>Page not found</h1>
        <p>
            Sorry, we couldn't find that page. It may have been renamed or removed
            in the version of the documentation you're currently browsing.
        </p>
        <p>
            If you're currently browsing the
            <em>latest</em> version of the documentation, try browsing the
            <a href="/en/stable/"><em>stable</em> version of the documentation</a>.
        </p>
        <p>
            Alternatively, use the
            <a href="#" onclick="$('#rtd-search-form [name=\\'q\\']').focus()">Search docs</a>
            box on the left or <a href="/">go to the homepage</a>.
        </p>
    """,
}

Js URLs added by Sphinx are not fixed

If you see the source code of, https://sphinx-notfound-page.readthedocs.io/not/found/page.html you will see this:

<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>

These files are added by Sphinx itself at

https://github.com/sphinx-doc/sphinx/blob/eb76799a89e7517fc28149046bfa358a2b1672d0/sphinx/builders/html.py#L304-L307

and they are rendered in the template at

https://github.com/sphinx-doc/sphinx/blob/eb76799a89e7517fc28149046bfa358a2b1672d0/sphinx/themes/basic/layout.html#L92

sphinx-rtd-theme uses the same tag to render it

https://github.com/rtfd/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/layout.html#L39

So, it seems that the tag js_tag is not picking our own pathto to generate the proper URL for these files,

https://github.com/sphinx-doc/sphinx/blob/eb76799a89e7517fc28149046bfa358a2b1672d0/sphinx/builders/html.py#L1172

I'm not sure why this is happening yet, but this makes some things to be broken on Read the Docs: the flyout menu on a 404 page, for example.

Clarify: is extension safe for parallel reading?

When I run make webdocs I see this warning:

WARNING: the notfound.extension extension does not declare if it is safe for parallel reading, assuming it isn't - please ask the extension author to check and make it explicit
WARNING: doing serial read

Python version: 3.7.3
Sphinx version: 1.7.9

Image path points to wrong directory

I'm having trouble including an image in my custom 404 page. If I add an image as docs/docsite/rst/images/foo.png and a custom 404 file docs/docsite/rst/404.rst that looks like this:

.. _page_not_found:

Oops!
=====

The page you're looking for doesn't exist in this version of the documentation.

.. image:: images/foo.png
   :alt: Custom 404

Return to the :ref:`index page for this version <index_anchor_name>`.

then build the docsite with config settings in the conf.py that look like this:

notfound_default_language = "foo"
notfound_default_version = "1.0"
notfound_no_urls_prefix = False
# no value set for notfound_template
# no value set for notfound_context

The 404 page gets built, the stylesheets and all toctree links load correctly for pages at any level of the filetree (hooray!).

However, in the HTML output, Sphinx places the image in a folder called _static/images/ (and places some other images in a folder called _images), but the path in the HTML output for the 404 page points to a folder called images:

<img alt="Custom 404" src="/foo/1.0/images/foo.png" />

Instead of the image, the alternate text appears in the HTML of the 404 page. Any pointers for me?

Read the Docs one `/_/` special URLs

If you go to https://docs.readthedocs.io/en/stable/notfound and open the Javascript console you will see that the file https://docs.readthedocs.io/en/stable/_/static/javascript/readthedocs-doc-embed.js returned 404. For some reason, this URL is being changed when it should not.

The valid URL for this case is https://docs.readthedocs.io/_/static/javascript/readthedocs-doc-embed.js. Note that it does not include /en/stable/

Related to #200
Related to #206

Problem with sub-projects

I have a problem using the extension with sub-projects on readthedocs, and versioned sub-projects in particular.

For example, it partly works with “latest”: https://docs.graphcore.ai/projects/available-memory/en/latest/xyz.html
The images and styles are present (because they are picked up from the root project).
But the navigation links don’t work (they go to the root project and hence the root 404 page, which is kinda OK but not ideal)

On version branches the images and styles are not found because there is no equivalent version in the root project (e.g. it is linking to /en/1.0.0/_static/css/theme.css)
For example: https://docs.graphcore.ai/projects/available-memory/en/1.0.0/xyz.html

So, apparently, I need to set the UL prefix correctly. I tried the following settings:

  1. Setting notfound_urls_prefix = "/" or notfound_urls_prefix = None results in exactly the same behaviour as the default setting, including for "latest" as well as versions.

  2. Always go to the parent project for resources and links

notfound_urls_prefix = "/en/latest/"

This makes the versions act like “latest”. So the page looks OK, but the links are not correct.
For example: https://docs.graphcore.ai/projects/available-memory/en/2.1.0/xyz.html

  1. Always go to the correct project and version for resources and links
notfound_urls_prefix = "/projects/available-memory/en/2.2.0/“

In this case, everything works exactly as expected. Page looks correct and the links are correct.
For example: https://docs.graphcore.ai/projects/available-memory/en/2.2.0/xyz.html

However, this means that notfound_urls_prefix needs to be set specifically for every project and version. Which is doable (I already have to customise conf.py for each document) but it would be nicer if I didn't have to.

So I wonder if there is a better way?


Versions:

  • Sphinx==3.4.3
  • sphinx_rtd_theme==0.5.1
  • docutils==0.16
  • sphinx-notfound-page

`/en/latest` prefix still added with `notfound_no_urls_prefix = True` set

@humitos @banesullivan thank you for writing a plugin for custom 404 pages in sphinx. We'd like to use it in our documentation.

Our docs URLs look like https://docs.ourdomain.com/project_name/version_name/page.html. I added the notfound-page extension and set notfound_no_urls_prefix = True in my Sphinx conf.py, but in the html output (404.html) I still see paths with the default en/latest in the path:

<link rel="stylesheet" href="/en/latest/_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="/en/latest/_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="/en/latest/genindex.html" />
<link rel="search" title="Search" href="/en/latest/search.html" /> 

Is this a bug, or am I misunderstanding/misusing the extension?

I'm a technical writer, not a python dev, but I'd be happy to get involved if I can help get this project to a 1.0 release.

Add `:orphan:` to the default 404 page generated.

If the extension is used without any configuration, a 404.rst page is created but since it does not has :orphan: on it, Sphinx will raise a WARNING saying that it's not included in the toctree.

Let's figure out how to disable this warning when using the default configs.

Use template instead of context data

Sphinx already has mechanisms for templating that I think would be more helpful than passing in the html content through a context variable. This should rely on a 4xx.html or 404.html (or both), so that the customer has complete control over how the page is rendered, not just the text that is used as part of the body.

Rendering the 404 page causes AttributeError: 'Sphinx' object has no attribute 'get_target_uri'

Hi, I tried to add sphinx-notfound-page (Version 0.6 or master) for Flask (with Pallets Sphinx Themes).

with the following conf:

extensions = [
    # ...
    'notfound.extension',
]
notfound_template = '404.html'
notfound_urls_prefix = None

then the build failed:

Running Sphinx v3.5.4
loading translations [en]... done
making output directory... done
...
generating indices... genindex py-modindex done

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/sphinx/builders/html/__init__.py", line 1054, in handle_page
    output = self.templates.render(templatename, ctx)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/readthedocs_ext/readthedocs.py", line 185, in rtd_render
    content = old_render(template, render_context)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/sphinx/jinja2glue.py", line 192, in render
    return self.environment.get_template(template).render(context)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/jinja2/environment.py", line 1127, in render
    self.environment.handle_exception()
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/jinja2/environment.py", line 814, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/pallets_sphinx_themes/themes/pocoo/404.html", line 3, in top-level template code
    {% set title = _('Page Not Found') %}
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/pallets_sphinx_themes/themes/pocoo/layout.html", line 22, in top-level template code
    {% set version_warning = current_version.banner() if current_version %}
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/jinja2/sandbox.py", line 382, in call
    return __context.call(__obj, *args, **kwargs)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/pallets_sphinx_themes/versions.py", line 156, in banner
    ).format(latest=latest.name, href=latest.href(context))
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/pallets_sphinx_themes/versions.py", line 134, in href
    path = builder.get_target_uri(pagename)
AttributeError: 'Sphinx' object has no attribute 'get_target_uri'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/sphinx/cmd/build.py", line 280, in build_main
    app.build(args.force_all, filenames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/sphinx/application.py", line 352, in build
    self.builder.build_update()
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 298, in build_update
    len(to_build))
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 363, in build
    self.finish()
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/sphinx/builders/html/__init__.py", line 622, in finish
    self.finish_tasks.add_task(self.gen_pages_from_extensions)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/sphinx/util/parallel.py", line 49, in add_task
    res = task_func()
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/sphinx/builders/html/__init__.py", line 646, in gen_pages_from_extensions
    self.handle_page(pagename, context, template)
  File "/home/docs/checkouts/readthedocs.org/user_builds/flaskx/envs/fix-docs-404/lib/python3.7/site-packages/sphinx/builders/html/__init__.py", line 1062, in handle_page
    (pagename, exc)) from exc
sphinx.errors.ThemeError: An error happened in rendering the page 404.
Reason: AttributeError("'Sphinx' object has no attribute 'get_target_uri'")

Theme error:
An error happened in rendering the page 404.
Reason: AttributeError("'Sphinx' object has no attribute 'get_target_uri'")

Full build log: https://readthedocs.org/projects/flaskx/builds/13534094/

The error related to this line in Pallets Sphinx Theme. I'm not quite sure if it's an issue of sphinx-notfound-page since I'm not very familiar with Sphinx, any thoughts will be helpful. Thanks!

Related issue: pallets/pallets-sphinx-themes#34

Main title link points to default version instead of current one

Using #8 I found that if you click in the main top-left-title link you go to /default-language/default-version. I think this is because of the pathto being overriden.

Although, we should find a way to make only that link points to the top level of the current version.

Toctree links always use default language and version

The notfound_default_language and notfound_default_version settings are not getting picked up everywhere when the 404 page gets built. When I build a custom 404 page with:

notfound_default_language = "foo"
notfound_default_version = "1.0"
notfound_no_urls_prefix = False

the stylesheets load correctly for pages at any level of the filetree (hooray!). However, the links in the left navigation still use /en/latest. For example:

<a class="reference internal" href="/en/latest/installation_guide/index.html">Installation Guide</a>

So if you click on any link from the TOC on the custom 404 page, you get another 404.

I think this is related to #14 and possibly also to #9. I'll see if I can figure out more details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.