-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👌 IMPROVE: Use reference name by default for internal link cards
For cards that link to internal references, we can use the associated name of the reference to supply the link text, so that the link isn't left blank if `link-alt` is not provided.
- Loading branch information
Showing
6 changed files
with
132 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
(cards-clickable)= | ||
## Cards Clickable | ||
|
||
## Clickable cards | ||
|
||
Using the `link` and `link-type` options, you can turn an entire card into a clickable link. Try hovering over then clicking on the cards below: | ||
|
||
:::{card} Clickable Card (external) | ||
:link: https://example.com | ||
:link-alt: example.com | ||
|
||
The entire card can be clicked to navigate to <https://example.com>. | ||
|
||
For **external** link cards, if you do not provide `link-alt`, the URL will be used as the text of the link. Using URLs as link text makes it harder for disabled people and for search engines to digest your web page, so it's best to provide link text via the `link-alt` option. | ||
::: | ||
|
||
:::{card} Clickable Card (internal) | ||
:link: cards-clickable | ||
:link-type: ref | ||
|
||
The entire card can be clicked to navigate to the `cards` reference target. | ||
The entire card can be clicked to navigate to the `cards-clickable` reference target. | ||
|
||
For **internal** link cards, it's unnecessary to provide `link-alt`. The name of the section that you are referencing will be used as the link's accessible name. For example, this card references `cards-clickable`, so the link title will be "Clickable cards" (same as the section heading). If you wish to use a different title for the link, you can provide `link-alt` and it will take precedence. | ||
::: | ||
|
||
Note: you cannot add additional links to the clickable card, neither in the card title nor in the card body. The entire card becomes a single link to the destination you specify, which overrides any other links inside the card. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
.. _cards-clickable: | ||
|
||
Cards Clickable | ||
Clickable cards | ||
............... | ||
|
||
Using the ``link`` and ``link-type`` options, you can turn an entire card into a clickable link. Try hovering over then clicking on the cards below: | ||
|
||
.. card:: Clickable Card (external) | ||
:link: https://example.com | ||
:link-alt: example.com | ||
|
||
The entire card can be clicked to navigate to https://example.com. | ||
|
||
For **external** link cards, if you do not provide ``link-alt``, the URL will be used as the text of the link. Using URLs as link text makes it harder for disabled people and for search engines to digest your web page, so it's best to provide link text via the ``link-alt`` option. | ||
|
||
.. card:: Clickable Card (internal) | ||
:link: cards-clickable | ||
:link-type: ref | ||
|
||
The entire card can be clicked to navigate to the ``cards`` reference target. | ||
The entire card can be clicked to navigate to the ``cards-clickable`` reference target. | ||
|
||
For **internal** link cards, it's unnecessary to provide ``link-alt``. The name of the section that you are referencing will be used as the link's accessible name. For example, this card references ``cards-clickable``, so the link title will be "Clickable cards" (same as the section heading). If you wish to use a different title for the link, you can provide ``link-alt`` and it will take precedence. | ||
|
||
Note: you cannot add additional links to the clickable card, neither in the card title nor in the card body. The entire card becomes a single link to the destination you specify, which overrides any other links inside the card. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters