Create function to allow a reusable to link current article in a different docs version (#34273)
Co-authored-by: Peter Bengtsson <peterbe@github.com>
This commit is contained in:
@@ -4,7 +4,7 @@ Welcome to the content style guide for [GitHub Docs](https://docs.github.com/).
|
||||
|
||||
These guidelines are specific to GitHub’s documentation. For general style questions or guidance on topics not covered here, see the [Microsoft Style Guide](https://docs.microsoft.com/style-guide/welcome/). For markup specific to source content on docs.github.com, see our [markup reference guide](content-markup-reference.md). For any questions about the GitHub brand, see our "[GitHub Brand Guide](https://brand.github.com)"
|
||||
|
||||
Use table of contents icon <img src="../assets/images/table-of-contents.png" width="25" height="25" /> on the top left corner of this document to get to a specific section of this guide quickly.
|
||||
Use table of contents icon <img src="../assets/images/table-of-contents.png" width="25" height="25" /> on the top right corner of this document to get to a specific section of this guide quickly.
|
||||
|
||||
## The GitHub Docs approach to style
|
||||
|
||||
@@ -342,11 +342,13 @@ For more information on links and accessibility, see “[Links](https://readabil
|
||||
|
||||
### Links between versions
|
||||
|
||||
Sometimes, you need to link from one version of GitHub Docs to another. For example, the Free, Pro, & Team version of "[Managing the publication of GitHub Pages sites for your organization](https://docs.github.com/en/organizations/managing-organization-settings/managing-the-publication-of-github-pages-sites-for-your-organization)" might link to the Enterprise Cloud version of the same article like this:
|
||||
Sometimes, you need to link from one version of GitHub Docs to another. When you want to link to a different version of the _same_ page, you should use the `currentArticle` property.
|
||||
|
||||
For example, the Free, Pro, & Team version of "[Managing the publication of GitHub Pages sites for your organization](https://docs.github.com/en/organizations/managing-organization-settings/managing-the-publication-of-github-pages-sites-for-your-organization)" might link to the Enterprise Cloud version of the same article like this:
|
||||
|
||||
>You can choose to allow or disallow the publication of GitHub Pages sites.
|
||||
>
|
||||
>Organizations that use GitHub Enterprise Cloud can choose to allow publicly published sites, privately published sites, both, or neither. For more information, see [the GitHub Enterprise Cloud documentation](/enterprise-cloud@latest/organizations/managing-organization-settings/managing-the-publication-of-github-pages-sites-for-your-organization).
|
||||
>Organizations that use GitHub Enterprise Cloud can choose to allow publicly published sites, privately published sites, both, or neither. For more information, see [the GitHub Enterprise Cloud documentation](/enterprise-cloud@latest/{{ currentArticle }}).
|
||||
|
||||
To link to a different article in a different version, use this format:
|
||||
|
||||
@@ -354,9 +356,9 @@ To link to a different article in a different version, use this format:
|
||||
|
||||
To link to the same article in a different version, use this format:
|
||||
|
||||
> For more information, see [the VERSION documentation]().
|
||||
> For more information, see [the VERSION documentation](/VERSION/{{ currentArticle }}).
|
||||
|
||||
To link to a specific version, you must include the version in the path (e.g., `/enterprise-cloud@latest/admin/overview/about-enterprise-accounts`).
|
||||
To link to a specific version, you must include the version in the path (e.g., `/enterprise-cloud@latest/{{ currentArticle }}`).
|
||||
|
||||
### Links to specific sections of articles
|
||||
|
||||
|
||||
Reference in New Issue
Block a user