Setting up Search.gov for Cloud.gov Pages sites
For over 20 years, GSA’s Search.gov has transformed the public’s search experience on federal government websites. Agencies use our free, shared service to power over 2,000 search boxes on over 30% of federal domains. This page will walk you through the steps required to integrate Search.gov with your Cloud.gov Pages website. Examples are for websites using the Jekyll site template.
You can get everything set up with us before launching your website, except for actually indexing your content. We will index your pages after the website is live.
If you wish to test before launch, you’ll need to publish the website to a publicly accessible domain such as demo.example.gov. You’ll work with your agency’s DNS team to set this up, and then follow the instructions below.
On the Cloud.gov Pages side of things, part 1
- Open your
_config.ymlfile in your Cloud.gov Pages repo. In thepluginssection, confirm that thejekyll-sitemapgem is in the list. For more information, read the docs here and the instructions for GitHub Pages here. - Discuss and decide which search results page to use. We recommend you use our hosted search results page. You can also pull search results into your website for display. Please note that at this time, pulling search results into your website will result in an incomplete set of search analytics.
On the Search.gov side of things:
- Sign up for a user account.
- Read our Search Site Launch Guide if you’d like some direction.
- Create and configure a search site in our Admin Center, as described in the Search Site Launch Guide. Highlights include:
- Request that we index your domain by emailing our team. Note, the site must be publicly available for our indexer to be able to access your content.
- Preview your search results once the indexing is complete.
On the Cloud.gov Pages side of things, part 2
- Open the
_config.ymlfile in your Cloud.gov Pages repo. - Add your site's domain to the
urlfield, approximately line 25. Leave this line commented out for now.
- If you're testing pre-production, enter your demo domain in the
urlfield, and uncomment the line to allow the XML sitemap to build using this demo domain.
- If you're testing pre-production, enter your demo domain in the
- Find the
Search.gov configurationsection following the navigation and sidebar configuration sections. Add your site handle from the Admin Center to theaffiliateline. - If you are using the hosted search results page:
- Delete the value in the
access_keyline and/or comment out the line. - Set the
inlinevalue tofalse.
- Delete the value in the
- If you're pulling search results into your website for display:
- Go to the Search.gov Admin Center, and find the
Activatesection,API Access Key. Copy this value to theaccess_keyline in your Cloud.gov Pages_config.ymlfile.
- Go to the Search.gov Admin Center, and find the
- If you do not want type-ahead search suggestions to appear in your website’s search box, change the
suggestionsvalue tofalse. - When you're ready to launch your website, you will uncomment the
urlline, to allow your XML sitemap to build using your production domain. Then, let our team know you're live and we'll begin indexing.
- If you tested using a demo domain, you'll need to update the
urlvalue to be your production domain.
- If you tested using a demo domain, you'll need to update the