-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update Docusaurus search configs for sitemap and start urls #438
Update Docusaurus search configs for sitemap and start urls #438
Conversation
I had to put the "stop_urls": [
"help",
"users",
"https://docusaurus.io/docs/en/[0-9].*"
], Could it be possible to only index major versions? The integration will change: <!-- at the end of the HEAD -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
<!-- at the end of the BODY -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
<script type="text/javascript"> docsearch({
apiKey: '3eb9507824b8be89e7a199ecaa1a9d2c',
indexName: 'docusaurus',
inputSelector: '### REPLACE ME ####',
algoliaOptions: { 'facetFilters': ["lang:$LANG", "version:$VERSION", "tags:$TAGS"] },
debug: false // Set debug to true if you want to inspect the dropdown
});
</script>
|
(Changes are live, you can check it now) |
Hi @s-pace 👋 Thanks for your help here. Currently for Docusaurus, the default documentation is corresponds to the latest version of Docusaurus. So in our current case, it is In https://docusaurus.io/en/versions.html, that corresponds to:
So to answer your question, maybe, we only search
Should we also have |
…without .html (redirection should be needed) #438
Thank you for your feedback. I have checked with the team and we can index every versions of the website https://docusaurus.io if you need it. Otherwise we can only do the latest one. Up to you and let me know. As for the other forked projects, we will firstly only crawl the latest version.
Done. It is live. In order to avoid duplicates, please leverage: 'facetFilters': ["lang:$LANG", "version:$VERSION", "tags:$TAGS"] We have also noticed that pages from the latest version are available under URLs with or without trailing |
Hi @s-pace Thanks for updating the config... A couple of questions: Right now, on https://docusaurus.io, we are seeing duplicates (from the current version and
Redirection within the Algolia config? Or redirection in the core Docusaurus code/site? By default, all Docusaurus sites have Thanks! |
In order to leverage the version you can only use the right version facet: 'facetFilters': ["version:latest"] This is the classic usage of algolia parameter
The redirection will be within your core website. Since two different URLs are available under HTTP 200, we do scrap both of them ( If you are fine with the DocSearch Search UI redirecting to .html pages, you don't have to bother.
👍 You got it. Since we pick up the whole URL, we are redirecting to this one. Thank you for the insight. Feel free to ask us anything |
👋 @s-pace Does facebook/docusaurus#744 seem reasonable and like the right way to go? |
@JoelMarcey Yep you will only need to replace VERSION and LANGUAGE with the right one. Merging it and I will comment facebook/docusaurus#744 |
Use db60b72 for the actual Docusaurus site