Sourcegraph hosts community landing pages to help open source community members discover, onboard, and search their code. Good examples include the Kubernetes and Stanford landing pages. The pages are based on search contexts (a named collection of repositories and revisions).
First, create the search context:
- Make sure you are a site-admin on Cloud
- Identify the requirements for the community search contexts page. What repos should be included in the search context? What examples would be worth highlighting?
- Create a new search context: Create page
- Select the “Global owner” option from the Owner dropdown (this will make the context available to all users on Cloud)
- Enter the context name (e.g.
- Enter a description (Markdown is supported)
- Select the “Public” visibility
- Enter the repositories as a JSON config (see Stanford edit page for example configuration)
- Click “Test configuration” to check if the configuration is in the correct format and that all of the entered repositories exist
- Finally, you can create the search context
Second, create the corresponding community search context page in the main Sourcegraph repository. This is a temporary measure and will be automated in the future. Steps:
- Copy an existing page config (e.g. Stanford) and adjust the necessary data
- Important: The
specproperty should match the search context name you created in the first step
- Important: The
- Add the corresponding route to the client router
- Add the same route to the backend router as well
- Tag the search-product team to review & approve the changes (or if you need help adding the page)