diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eb5112fc9..42fb3dc7d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -75,6 +75,7 @@ list_code_example: # Code example included with article descriptions in children list_query_example: # Code examples included with article descriptions in children type="articles" shortcode, # References to examples in data/query_examples products: # List of products that the page specifically applies to: [oss, cloud, enterprise] +canonical: # Path to canonical page, overrides auto-gen'd canonical URL ``` #### Title usage @@ -644,6 +645,25 @@ Redoc generates HTML documentation using the InfluxDB `swagger.yml`. For more information about generating InfluxDB API documentation, see the [API Documentation README](https://github.com/influxdata/docs-v2/tree/master/api-docs#readme). +## Canonical URLs +Search engines use canonical URLs to accurately rank pages with similar or identical content. +The `canonical` HTML meta tag identifies which page should be used as the source of truth. + +By default, canonical URLs are automatically generated for each page in the InfluxData +documentation using the latest version of the current product and the current path. + +Use the `canonical` frontmatter to override the auto-generated canonical URL. + +_**Note:** The `canonical` frontmatter supports the [`{{< latest >}}` shortcode](#latest-links)._ + +```yaml +canonical: /path/to/canonical/doc/ + +# OR + +canonical: /{{< latest "influxdb" "v2" >}}/path/to/canonical/doc/ +``` + ## InfluxDB URLs When a user selects an InfluxDB product and region, example URLs in code blocks throughout the documentation are updated to match their product and region. diff --git a/api-docs/template.hbs b/api-docs/template.hbs index f886dbfcd..bedacd61c 100644 --- a/api-docs/template.hbs +++ b/api-docs/template.hbs @@ -39,7 +39,8 @@
- InfluxDB {{templateOptions.version}} Docs + InfluxDB {{templateOptions.version}} Docs + Submit API issue
{{{redocHTML}}}