Links
Choose your link type based on the applicable scenario:
- Link from source content that’s used in multiple projects
- Link to grafana.com pages
- Link to external pages
- Link to page headings
Although these other types of links still function, replace them with full URLs:
Link from source content that’s used in multiple projects
Use the docs/reference
shortcode.
The source is reused as described in Reuse directories of content with Hugo mounts.
For more information and examples, refer to docs/reference
shortcode.
Link to grafana.com pages
Use a full URL with version substitution syntax (if needed).
Version substitution is necessary for full URLs to link to the correct version of documentation. Usually, this is the current version of documentation.
In versioned documentation, set the correct version in the root _index.md
file for your documentation.
The following YAML example merges with the existing front matter in the root _index.md
file, and sets GRAFANA_VERSION
to be latest
for that page and all child pages.
cascade:
GRAFANA_VERSION: latest
Examples
Link to Grafana documentation:
Start with https://grafana.com/docs/grafana/<GRAFANA_VERSION>/
, and add the rest of the URL path.
For example, to link to the Developers page with version substitution, use:
https://grafana.com/docs/grafana/<GRAFANA_VERSION>/developers/
- If you’re linking from Grafana documentation,
<GRAFANA_VERSION>
is substituted with the version inferred from the page’s URL. - If you’re linking from other documentation,
<GRAFANA_VERSION>
is substituted with the value ofGRAFANA_VERSION
from the source page’s front matter.
Link to Grafana Cloud documentation:
Grafana Cloud documentation is not versioned so no version substitution syntax is needed. Use the full URL.
For example, to link to the Author and run tests page, use:
https://grafana.com/docs/grafana-cloud/k6/author-run/
Link to Mimir documentation:
Start with https://grafana.com/docs/grafana/<MIMIR_VERSION>/
, and add the rest of the URL path.
For example, to link to the Release notes page with version substitution, use:
https://grafana.com/docs/mimir/<MIMIR_VERSION>/release-notes/
- If you’re linking from Mimir documentation,
<MIMIR_VERSION>
is substituted with the version inferred from the page’s URL. - If you’re linking from other documentation,
<MIMIR_VERSION>
is substituted with the value ofMIMIR_VERSION
from the source page’s front matter.
Link to external pages
Use the full URL.
For example:
https://github.com
Link to page headings
Link to a heading on a page in one of two ways.
From within the same page:
Read more in the [Configuration section](#configuration) of this page.
From a different page:
Read more in the [Grafana Open Source section of the Introduction page](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/fundamentals/#grafana-open-source).
To convert a heading to an anchor, make the following changes:
- Convert to lower case.
- Remove any period characters (
.
). - Replace any character that’s not a lower cased letter, a number, or an underscore (
_
) with dashes (-
). - Trim any preceding or proceeding dashes (
-
). - Prefix with a
#
.
The heading Link to page headings becomes the anchor #link-to-page-headings
.