Skip to content

Commit

Permalink
Merge pull request #11674 from quarto-dev/lightbox-improvment
Browse files Browse the repository at this point in the history
  • Loading branch information
cderv authored Dec 13, 2024
2 parents 46a7609 + db8e27b commit cb09d52
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 1 deletion.
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>.

0 comments on commit cb09d52

Please sign in to comment.