Skip to content

Commit a9bf789

Browse files
authored
Update internal docs about links (github#27136)
* Document the existence of legacy filepaths in links * Add examples of how links are formed * Add convention for linking to section within an article * Clarify "local links"
1 parent 8dd4b7c commit a9bf789

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

content/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,11 @@ Just add a hyphen on either the left, right, or both sides to indicate that ther
336336

337337
## Links and image paths
338338

339-
Local links must start with a product ID (like `/actions` or `/admin`), and image paths must start with `/assets`. The links to Markdown pages undergo some transformations on the server side to match the current page's language and version. The handling for these transformations lives in [`lib/render-content/plugins/rewrite-local-links`](lib/render-content/plugins/rewrite-local-links.js).
339+
Links to docs in the `docs-internal` repository must start with a product ID (like `/actions` or `/admin`) and contain the entire filepath, but not the file extension. For example, `/actions/creating-actions/about-custom-actions`.
340+
341+
Image paths must start with `/assets` and contain the entire filepath including the file extension. For example, `/assets/images/help/settings/settings-account-delete.png`.
342+
343+
The links to Markdown pages undergo some transformations on the server side to match the current page's language and version. The handling for these transformations lives in [`lib/render-content/plugins/rewrite-local-links`](lib/render-content/plugins/rewrite-local-links.js).
340344

341345
For example, if you include the following link in a content file:
342346

@@ -364,6 +368,12 @@ Sometimes you want to link to a Dotcom-only article in Enterprise content and yo
364368

365369
Sometimes the canonical home of content moves outside the docs site. None of the links included in [`lib/redirects/external-sites.json`](/lib/redirects/external-sites.json) get rewritten. See [`contributing/redirects.md`](/contributing/redirects.md) for more info about this type of redirect.
366370

371+
### Legacy filepaths and redirects for links
372+
373+
Our docs contain links that use legacy filepaths such as `/article/article-name` or `/github/article-name`. Our docs also contain links that refer to articles by past names. Both of these link types function properly because of redirects, but they are bugs.
374+
375+
When you add a link to an article, use the current filepath and article name.
376+
367377
### Index pages
368378

369379
Index pages are the Table of Contents files for the docs site. Every product, category, and map topic subdirectory has an `index.md` that serves as the landing page. Each `index.md` must contain a `children` frontmatter property with a list of relative links to the child pages of the product, category, or map topic.

contributing/content-style-guide.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,11 @@ For plain text, use linebreaks to separate paragraphs in the source (two consecu
230230

231231
## Links
232232

233-
Introduce links consistently using a standard format that clearly indicates where we’re linking: "For more information, see X [or "Page/article title"] in the X documentation." Do not include quotation marks within a hyperlink.
233+
Introduce links consistently using a standard format that clearly indicates where we’re linking.
234+
For links to other articles in the GitHub docs: `For more information, see "[Page or article title]()."`
235+
For links to another section in the same article: `For more information, see "[Header text]()."`
236+
For links to external documentation: `For more information, see [Page or article title]() in the X documentation.`
237+
Do not include quotation marks within a hyperlink.
234238

235239
Links should be meaningful and provide high value to the user’s journey - link out carefully. Move links that are helpful but not necessary to an article’s further reading section. Do not repeat the same link more than once in the same article or under the same H2 header.
236240

0 commit comments

Comments
 (0)