From 5385fe6eed28c99789a2669542facedcbc0f794f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Tue, 3 Nov 2026 15:23:51 +0100 Subject: [PATCH 1/2] docs: add target and rel options to website listings --- docs/websites/website-listings.qmd | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/websites/website-listings.qmd b/docs/websites/website-listings.qmd index 6e0b14eab3..e6a7113855 100644 --- a/docs/websites/website-listings.qmd +++ b/docs/websites/website-listings.qmd @@ -233,6 +233,34 @@ 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. +You can set them on the listing, on an item in the listing `contents`, or on both. +A value on an item replaces the value on the listing. +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`. +Screen readers announce each link that opens a new tab. + +Quarto reads these options only from the listing and from the items in the listing `contents`. +It does not read them from the front matter of a listed document. +RSS feeds and custom listing templates do not use these options. + ## 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: From 3eee6427a20b556ae833111e55a34f11b2ea57df Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Wed, 4 Nov 2026 15:09:00 +0100 Subject: [PATCH 2/2] docs: align listing link options with merged behavior --- docs/websites/website-listings.qmd | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/websites/website-listings.qmd b/docs/websites/website-listings.qmd index e6a7113855..71f4e63e7f 100644 --- a/docs/websites/website-listings.qmd +++ b/docs/websites/website-listings.qmd @@ -239,8 +239,10 @@ In addition to the above listing-wide options, each listing type has a variety o 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. -You can set them on the listing, on an item in the listing `contents`, or on both. -A value on an item replaces the value on the listing. +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 @@ -255,11 +257,14 @@ listing: ``` If `target` opens a new tab and `rel` is not set, `rel` is `noopener`. -Screen readers announce each link that opens a new tab. +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`. -Quarto reads these options only from the listing and from the items in the listing `contents`. -It does not read them from the front matter of a listed document. -RSS feeds and custom listing templates do not use these options. +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