diff --git a/news/changelog-1.9.md b/news/changelog-1.9.md index 9c327bc5e1d..e5ae86f20ac 100644 --- a/news/changelog-1.9.md +++ b/news/changelog-1.9.md @@ -79,6 +79,7 @@ All changes included in 1.9: - ([#13570](https://github.com/quarto-dev/quarto-cli/pull/13570)): Replace Twitter with Bluesky in default blog template and documentation examples. New blog projects now include Bluesky social links instead of Twitter. - ([#13716](https://github.com/quarto-dev/quarto-cli/issues/13716)): Fix draft pages showing blank during preview when pre-render scripts are configured. - ([#13847](https://github.com/quarto-dev/quarto-cli/pull/13847)): Open graph title with markdown is now processed correctly. (author: @mcanouil) +- ([#12293](https://github.com/quarto-dev/quarto-cli/pull/12293)): Add support for `target` attribute on listing item links. Users can specify `target: "_blank"` in listing item YAML to open links in a new tab. Works with default, grid, and table listing types. (author: @mcanouil) ### `book` diff --git a/src/project/types/website/listing/website-listing-read.ts b/src/project/types/website/listing/website-listing-read.ts index c8aacd50096..8375f898f33 100644 --- a/src/project/types/website/listing/website-listing-read.ts +++ b/src/project/types/website/listing/website-listing-read.ts @@ -557,7 +557,7 @@ function hydrateListing( // If the items have come from metadata, we should just show // all the columns in the table. Otherwise, we should use the // document default columns - const undisplayable = ["path"]; + const undisplayable = ["path", "target"]; return itemFields.filter((field) => { return !undisplayable.includes(field); }); diff --git a/src/project/types/website/listing/website-listing-template.ts b/src/project/types/website/listing/website-listing-template.ts index 50a538b23aa..6bf14c8d0a9 100644 --- a/src/project/types/website/listing/website-listing-template.ts +++ b/src/project/types/website/listing/website-listing-template.ts @@ -404,7 +404,9 @@ export function reshapeListing( const value = val || item[field] || " "; const path = item.path; if (path && value !== undefined && fieldLinks.includes(field)) { - return `${value}`; } else { diff --git a/src/resources/projects/website/listing/item-default.ejs.md b/src/resources/projects/website/listing/item-default.ejs.md index 91114a7867f..d17fbf95c58 100644 --- a/src/resources/projects/website/listing/item-default.ejs.md +++ b/src/resources/projects/website/listing/item-default.ejs.md @@ -32,7 +32,7 @@ return value; let value = readField(item, field); if (value !== undefined) { print(`
`); - } +} } %> @@ -41,7 +41,7 @@ print(`