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.yml
file in your Cloud.gov Pages repo. In theplugins
section, confirm that thejekyll-sitemap
gem 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.yml
file in your Cloud.gov Pages repo. - Add your site's domain to the
url
field, approximately line 25. Leave this line commented out for now.
- If you're testing pre-production, enter your demo domain in the
url
field, 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 configuration
section following the navigation and sidebar configuration sections. Add your site handle from the Admin Center to theaffiliate
line. - If you are using the hosted search results page:
- Delete the value in the
access_key
line and/or comment out the line. - Set the
inline
value 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
Activate
section,API Access Key
. Copy this value to theaccess_key
line in your Cloud.gov Pages_config.yml
file.
- 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
suggestions
value tofalse
. - When you're ready to launch your website, you will uncomment the
url
line, 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
url
value to be your production domain.
- If you tested using a demo domain, you'll need to update the