Skip to content

docsite(docs): add seo tags to template

Administrator requested to merge jh/docsite-seo into main

Created by: jhchabran

See the PR these changes depend on here: https://github.com/sourcegraph/docsite/pull/75 closes https://github.com/sourcegraph/docsite/issues/76

With the following front matter

---
title: "That current page title"
description: "A brief description of what that page is about"
category: "Which category of the content does this belong"
type: "article (will default to website otherwise)"
imageURL: "https://i.imgur.com/bLV8BPS.jpeg"
tags: 
  - A list of tags such as
  - Code Search
  - How to
---
# Batch Changes

and this specific settings appended to `docsite.json

  "rootURL": "https://docs.sourcegraph.com",

The generated HTML is:

<head>
  <! –– (...)  ––>
  <meta property="og:locale" content="en_EN">
  <meta content="That current page title - Sourcegraph docs" property="og:title">
  <meta content="article (will default to website otherwise)" property="og:type">
  <meta content="A brief description of what that page is about" property="og:description">
  <meta content="Which category of the content does this belong" property="article:section">
  <base href="https://docs.sourcegraph.com/batch_changes">
  <meta name="url" content="https://docs.sourcegraph.com/batch_changes">
  <meta name="twitter:url" content="https://docs.sourcegraph.com/batch_changes">
  <meta property="og:url" content="https://docs.sourcegraph.com/batch_changes">
  <meta content="A list of tags such as" property="article:tag">
  <meta content="Code Search" property="article:tag">
  <meta content="How to" property="article:tag">
  <meta itemprop="image" content="https://docs.sourcegraph.com/assets/logo-theme-light.svg">
  <meta property="og:image" content="https://i.imgur.com/bLV8BPS.jpeg">
  <meta name="twitter:image" content="https://i.imgur.com/bLV8BPS.jpeg">
  <! –– (...)  ––>
</head>

️ Reviewing this

  1. Please check the tags themselves, I am no expert on that topic! Please advise 🙏
  • 💡 This can be done while this is a draft.
  1. Implementation itself

TODO

  1. Merge the other PR
  2. Release a new version of docsite
  3. Make this repo use it (build will fail until this is done)
  4. Merge this
  5. Inform the relevant teams that they can now fill the SEO related fields

Merge request reports

Loading