Skip to content

Commit 67ae3e6

Browse files
sarahsethanpalm
andauthored
Document the new AUTOTITLE shortcut (#34462)
Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com>
1 parent b3594d7 commit 67ae3e6

File tree

3 files changed

+35
-7
lines changed

3 files changed

+35
-7
lines changed

Diff for: content/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@ and when viewed on GitHub Enterprise Server docs, the version is included as wel
357357
/en/enterprise-server@2.20/github/writing-on-github/creating-a-saved-reply
358358
```
359359
360+
### Using AUTOTITLE for internal links
361+
362+
If you create an internal link, you can use the AUOTITLE keyword to generate an article's title in the rendered link. See the [markup reference](../contributing/content-markup-reference.md#internal-links-with-autotitle) for details.
363+
360364
### Linking to the current article in a different version of the docs
361365
362366
Sometimes you may want to link from an article to the same article in a different product version. For example:

Diff for: contributing/content-markup-reference.md

+15
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- [Usage](#usage-5)
1717
- [Reusable and variable strings of text](#reusable-and-variable-strings-of-text)
1818
- [Tables with codeblocks](#tables-with-codeblocks)
19+
- [Internal links with AUTOTITLE](#internal-links-with-autotitle)
1920

2021
## Writing in Markdown
2122

@@ -254,3 +255,17 @@ If this happens, add the following CSS style to the `<table>` HTML tag:
254255
```
255256

256257
For a current example of this usage, see the [GitHub Actions examples workflow library](https://docs.github.com/en/actions/examples).
258+
259+
## Internal links with AUTOTITLE
260+
261+
When linking to another GitHub docs page, use standard Markdown syntax like `[]()` but type `AUTOTITLE` instead of the page title. The application will replace `AUTOTITLE` with the title of the linked page during rendering. This special keyword is case-sensitive, so take care with your typing or the replacement will not work.
262+
263+
### Usage
264+
265+
- `For more information, see "[AUTOTITLE](/path/to/page)."`
266+
- `For more information, see "[AUTOTITLE](/path/to/page#section-link)."`
267+
- `For more information, see the TOOLNAME documentation in "[AUTOTITLE](/path/to/page?tool=TOOLNAME)."`
268+
269+
Note that **same-page section links do not work** with this keyword. Type out the full header text instead.
270+
271+
Read more about links in the [content style guide](./content-style-guide.md#links).

Diff for: contributing/content-style-guide.md

+16-7
Original file line numberDiff line numberDiff line change
@@ -332,17 +332,26 @@ For plain text, use linebreaks to separate paragraphs in the source (two consecu
332332

333333
## Links
334334

335-
Introduce links consistently using a standard format that clearly indicates where were linking.
335+
Introduce links consistently using a standard format that clearly indicates where we're linking.
336336

337-
- For links to other articles in the GitHub docs: `For more information, see "[Page or article title]()."`
338-
- For links to another section in the same article: `For more information, see "[Header text]()."`
339-
- For links to specific sections in other articles in the GitHub docs: `For more information, see "[Article title]()."`
340-
- For links to an article with a specific tool selected: `For more information, see the TOOLNAME documentation in "[ARTICLE TITLE](/PATH/TO/ARTICLE?tool=TOOLNAME).`
341-
- For links to external documentation: `For more information, see [Page or article title]() in the X documentation.`
337+
For any link that points to another GitHub docs page, use the special keyword `AUTOTITLE`. See details in the [content markup reference](./content-markup-reference.md#internal-links-with-autotitle).
338+
339+
Usage examples:
340+
341+
- For links to other pages: `For more information, see "[AUTOTITLE](/path/to/page)."`
342+
- For links to sections in other pages: `For more information, see "[AUTOTITLE](/path/to/page#section-link)."`
343+
- For links to a page with a tool selected: `For more information, see the TOOLNAME documentation in "[AUTOTITLE](/path/to/page?tool=TOOLNAME).`
344+
345+
Same-page section links do **not** work with `AUTOTITLE`. Instead, type out the full header text: `For more information, see "[Header text](#section-link)."`
346+
347+
For links to external documentation, type out the full article name: `For more information, see [Page or article title](https://some-docs.com/path/to/page) in the X documentation.`
342348

343349
Do not include quotation marks within a hyperlink.
344350

345-
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.
351+
Some best practices for using links:
352+
- Links should be meaningful and provide high value to the user’s journey—link out carefully.
353+
- Move links that are helpful but not necessary to an article’s further reading section.
354+
- Do not repeat the same link more than once in the same article or under the same H2 header.
346355

347356
For accessibility and readability, avoid inline or midsentence links.
348357
- **Use:** OAuth2 tokens can be acquired programmatically for applications that are not websites. For more information, see "[Setting up and registering OAuth Apps](https://developer.github.com/apps/building-integrations/setting-up-and-registering-oauth-apps/)" and "[Create a new authorization](https://docs.github.com/en/enterprise-server@2.22/rest/reference/oauth-authorizations/#create-a-new-authorization)."

0 commit comments

Comments
 (0)