Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Book cover image shouldn't have lightbox treatment applied to #11674

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions news/changelog-1.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ All changes included in 1.7:

- ([#11654](https://github.com/quarto-dev/quarto-cli/issues/11654)): Allow `page-inset` as value in `column` key for code cells.

## Book Project

- ([#11520](https://github.com/quarto-dev/quarto-cli/issues/11520)): Book's cover image now escapes lightbox treatment, which was incorrectly applied to it when `lightbox: true` was set in the book's configuration.

## `quarto check`

- ([#11608](https://github.com/quarto-dev/quarto-cli/pull/11608)): Do not issue error message when calling `quarto check info`.
Expand Down
2 changes: 1 addition & 1 deletion src/project/types/book/book-render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export function bookPandocRenderer(
const title = file.recipe.format.metadata[kTitle] || "";
const alt = coverImageAlt ? ` fig-alt="${coverImageAlt}"` : "";
file.executeResult.markdown =
`![](${coverImage} "${title}"){.quarto-cover-image${alt}}\n\n` +
`![](${coverImage} "${title}"){.quarto-cover-image .nolightbox${alt}}\n\n` +
file.executeResult.markdown;
}

Expand Down
2 changes: 2 additions & 0 deletions tests/docs/smoke-all/2024/12/12/11520/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.quarto/
/_book/
16 changes: 16 additions & 0 deletions tests/docs/smoke-all/2024/12/12/11520/_quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
project:
type: book

book:
title: "mybook"
author: "Norah Jones"
date: "11/24/2024"
cover-image: cover.png
chapters:
- index.qmd

format:
html:
theme: cosmo

lightbox: true
Binary file added tests/docs/smoke-all/2024/12/12/11520/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions tests/docs/smoke-all/2024/12/12/11520/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
_quarto:
tests:
html:
ensureHtmlElements:
- ['section#preface .quarto-cover-image']
- ['.ligtbox > .quarto-cover-image']
---

# Preface {.unnumbered}

This is a Quarto book. Cover image should not have Lightbox treatment in books when `lightbox: true`

To learn more about Quarto books visit <https://quarto.org/docs/books>.
Loading