diff --git a/docs/websites/website-listings.qmd b/docs/websites/website-listings.qmd index 6e0b14eab3..71f4e63e7f 100644 --- a/docs/websites/website-listings.qmd +++ b/docs/websites/website-listings.qmd @@ -233,6 +233,39 @@ It is possible to customize the appearance of listings using the following optio In addition to the above listing-wide options, each listing type has a variety of options to customize its appearance. +### Link Targets + +{{< prerelease-callout 1.12 >}} + +Use the `target` and `rel` options to set the `target` and `rel` attributes of the item links. +These options have the same meaning as the `target` and `rel` options of navigation items. +They apply to default, grid, and table listings. +You can set them on the listing, on an item in the listing `contents`, or in a listed document's front matter. +Values in `contents` override the document's front-matter values. +For each option, a nonempty item value overrides the listing value. +For example, this listing opens all items in a new tab, except the local post: + +``` yaml +listing: + target: _blank + contents: + - path: https://example.com/article + title: "External article" + - path: posts/local-post.qmd + title: "Local post" + target: _self +``` + +If `target` opens a new tab and `rel` is not set, `rel` is `noopener`. +An explicit listing or item `target` takes precedence over `link-external-newwindow`. +For example, `target: _self` keeps an external item in the current tab even when `link-external-newwindow: true`. + +Listing item links with `target: _blank` receive the accessible description "(opens in a new tab)". +This applies to internal and external listing links, independently of `link-external-newwindow`. + +With `table-hover: true`, clicking a table row also honors its item link's `target` and `rel`. +RSS feeds and custom listing templates do not apply these options automatically. + ## Categories In addition to displaying the listing contents, listings can also automatically add a list of categories to the page that they appear on. To enable categories you can set the `categories` option like: