Closed Diveafall closed 3 years ago
I'm also having this issue, which seems to have been introduced in version 0.9.2. Prior to that, the search resources were placed in the module subdirectory, but now they are placed in the docs/
directory. This is a problem if you a serving the website from docs/module/
because higher-level resources will not be publicly accessible.
Not sure what the appropriate behavior should be — I presume there was a good reason why the search resources were moved up one level. Seems to be related to #250 and https://github.com/pdoc3/pdoc/commit/2e08bd8c3768031e59a8a662a2cf39f4a0e202ad
The recommended workaround is to instead:
- Serve generated documentation from inside api_docs
and put up a doorway page such as https://github.com/pdoc3/pdoc/issues/55#issuecomment-614247015.
Also related to https://github.com/pdoc3/pdoc/issues/101, https://github.com/pdoc3/pdoc/issues/233.
Expected Behavior
I have successfully generated documentation and I want to add offline search to it. After adding
lunr_search = {'fuzziness': 1, 'index_docstrings': True}
to myconfig.mako
it works fine when opened usingindex.html
inside the module subdirectory. However, when I serve the documentation on Netlify or even locally usingserve
theiframe
for the search results point to a file inside a parent directory resulting in a404
page.Actual Behavior
Search should work for documentation out of the box.
Steps to Reproduce
pdoc --html --output-dir api_docs --template-dir pdoc/templates hub
api_docs/hub
Additional info
The problem here is obviously that
doc-search.html
resides above the served site. How can this problem be solved?