docsite: allow content to be removed from the search index if it matc…#83
Merged
coury-clark merged 2 commits intomainfrom Feb 8, 2022
Merged
Conversation
…hes a pattern in the docsite config
efritz
approved these changes
Feb 8, 2022
LawnGnome
reviewed
Feb 8, 2022
Contributor
LawnGnome
left a comment
There was a problem hiding this comment.
This looks fine as it is, but which site is this for? For example, I believe handbook.sourcegraph.com doesn't use the built in search any more. (At the very least, it's fronted by swiftype; I don't know if it then falls back to the search when building its corpus.)
Contributor
Author
|
@LawnGnome This is for the docsite |
Contributor
Cool. 👍, then! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR will allow us to remove certain content files from the docsite search index if they match a pattern in the URL. We have a requirement from marketing that we remove some docs from our search results, and this seemed relatively straightforward.
Example JSON:
{ "$comment": "This configures the documentation server used in local development only. See ./doc/dev/documentation.md#previewing-changes-locally.", "templates": "_resources/templates", "content": ".", "baseURLPath": "/", "rootURL": "https://docs.sourcegraph.com", "assets": "_resources/assets", "assetsBaseURLPath": "/assets/", "check": { "ignoreURLPattern": "(^https?://)|(^#)|(^mailto:(hi|support|security|feedback)@sourcegraph\\.com(\\?|$))|(^chrome://)|(^/@)" }, "search": { "skipIndexURLPattern": ".*insights*." } }I was pretty split on how to implement this, and tried a few things:
<meta name="robots"...>HTML tag. Unfortunately, it seems that the HTML that is returned from the markdown parser doesn't include the HTML defined in the template file (obvious in hindsight...), and that seemed like a larger refactor that exceeds the bounds of how much we want to invest in this.