postmanlabs / postman-blog

MIT License
6 stars 5 forks source link

Add meta data for Google search sitelinks #299

Open tristandenyer opened 4 years ago

tristandenyer commented 4 years ago

This comes after we have a search results page, since it depends on that.

Ref: https://developers.google.com/search/docs/data-types/sitelinks-searchbox

tristandenyer commented 4 years ago

According to Google's tool, we are eligible for this feature.

Screen Shot 2020-05-19 at 11 09 09 PM

Using the following snippet:

<html>
  <head>
    <title>The title of the page</title>
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "WebSite",
      "url": "https://blog.postman.com/",
      "potentialAction": {
        "@type": "SearchAction",
        "target": "https://blog.postman.com/search/?query={search_term_string}",
        "query-input": "required name=search_term_string"
      }
    }
    </script>
  </head>
  <body>
  </body>
</html>