This tutorial shows how to reference and link to internal docs within a Stitch doc.
Where to find links
To understand how to link internal docs, you have to know how links work and where URLs are located.
Head to _includes/misc/data-files.html
. Inside this file is the Liquid that we use to simplify internal doc links, specifically:
{% assign link = site.data.urls %}
This creates a variable named link
with a value equal to site.data.urls
, which points to the file located at _data/urls.yml
. This file contains instructions on how use the values in the file to create links.
To learn more about data files and the built-in data file system, refer to the Jekyll Docs on the subject.
The link format
The formatting of the link is equivalent to a period-delimited file path: {{ link.[link-category].[link-id] | prepend: site.baseurl }}
The filter prepended to the link value (prepend: site.baseurl
) is equivalent to /docs
. Adding this filter to internal links is required, or the link URL will be missing the /docs
portion of the URL and lead to a 404.
See the example below from the Re-authorizing Integrations page:
**For SaaS integrations,** check out the Status Page for the problem integration to see if any issues have been reported. You can find a list of all our integrations' status pages in the [Third-Party Downtime article]({{ link.troubleshooting.third-party-downtime | prepend: site.baseurl }}).
The link in this example - {{ link.troubleshooting.third-party-downtime }}
- points to the following value in the _data/urls.yml
file:
troubleshooting:
third-party-downtime: /troubleshooting/third-party-integration-downtime
Which, when added to prepend: site.baseurl
, creates a link with a URL of: /docs/troubleshooting/third-party-integration-downtime
Back to top
Last updated: 20 July 2021