pdoc
pdoc copied to clipboard
search always gives no results
Expected Behavior
The search should return a list of results.
Actual Behavior
The search always returns No results.
Steps to Reproduce
- Generate docs with a
config.mako
in this style:
<%!
git_link_template = 'https://github.com/thesadru/genshinstats/blob/{commit}/{path}#L{start_line}-L{end_line}'
google_search_query = '''
inurl:github.com/thesadru/genshinstats
site:thesadru.github.io
'''
%>
- Try to search anything
alternatively just search on the Github pages I'm trying to use
https://thesadru.github.io/pdoc/genshinstats/
Additional info
- pdoc version:
0.9.2
I'm so sorry if this is some obvious bug, but I just can't figure out why.
screenshot:
This is the same as the configuration we are using, so it should work.
I notice Google only returns a single result for (site:thesadru.github.io OR inurl:github.com/thesadru/genshinstats) wrapper
. If fairly new, perhaps you need to wait a few more days for the sites, particularly the subdomain one, to get more properly indexed.
As an alternative, you can use JS-based index/search: https://github.com/pdoc3/pdoc/blob/c2c13200a630f97e5a7b2cba292b0dc9deb58b53/pdoc/templates/config.mako#L51-L56
I don't have much experience with lunr.js, so I didn't want to use it at first, but I'll use that then. I'll just hope it's only because it wasn't indexed yet. Thanks for the tip.
Google still hasn't indexed the site so I'm just gonna close this issue.
It sometimes takes days up to a few weeks. Let's keep this open, so it reminds me to check again later. I'd like to confirm.
Also experiencing this issue. My config.mako
:
<%!
# Use `{commit}` instead of `master` to insert current commit hash
git_link_template = 'https://github.com/nansencenter/DAPPER/blob/master/{path}#L{start_line}-L{end_line}'
sort_identifiers = False
# show_type_annotations = True
# show_source_code = False
latex_math = True
google_search_query = 'site:nansencenter.github.io/DAPPER'
%>
Googling site:nansencenter.github.io/DAPPER stats
produces many results
But only 1 hit when going through the local search box:
@patnr I have no explanation for it, but this is indeed what the custom search engine returns for this query.
Is the website fairly new? Maybe wait a while longer.
There's another search method using Lunr.js search: https://github.com/pdoc3/pdoc/blob/c2c13200a630f97e5a7b2cba292b0dc9deb58b53/pdoc/templates/config.mako#L51-L56 Does that work for you?
Thank you for the swift reply!
The website is >1 years old, and as you can see Google already very much indexes it. I'm not very experienced with web development, but do you have any pointers as to how I might track down the issue?
I will give lunr.js a try as well.
I tried creating my own search engine at https://cse.google.com/ . This works great.
So maybe the problem is with the cx
token used by pdoc?
https://github.com/pdoc3/pdoc/blob/c2c13200a630f97e5a7b2cba292b0dc9deb58b53/pdoc/templates/html.mako#L403
Could we allow for it to be a key in config.mako
? I'd be happy to make a PR