Skip to content

Commit cb09d52

Browse files
authored
Merge pull request #11674 from quarto-dev/lightbox-improvment
2 parents 46a7609 + db8e27b commit cb09d52

File tree

6 files changed

+37
-1
lines changed

6 files changed

+37
-1
lines changed

news/changelog-1.7.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ All changes included in 1.7:
1111

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

14+
## Book Project
15+
16+
- ([#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.
17+
1418
## `quarto check`
1519

1620
- ([#11608](https://github.com/quarto-dev/quarto-cli/pull/11608)): Do not issue error message when calling `quarto check info`.

src/project/types/book/book-render.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export function bookPandocRenderer(
173173
const title = file.recipe.format.metadata[kTitle] || "";
174174
const alt = coverImageAlt ? ` fig-alt="${coverImageAlt}"` : "";
175175
file.executeResult.markdown =
176-
`![](${coverImage} "${title}"){.quarto-cover-image${alt}}\n\n` +
176+
`![](${coverImage} "${title}"){.quarto-cover-image .nolightbox${alt}}\n\n` +
177177
file.executeResult.markdown;
178178
}
179179

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.quarto/
2+
/_book/
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
project:
2+
type: book
3+
4+
book:
5+
title: "mybook"
6+
author: "Norah Jones"
7+
date: "11/24/2024"
8+
cover-image: cover.png
9+
chapters:
10+
- index.qmd
11+
12+
format:
13+
html:
14+
theme: cosmo
15+
16+
lightbox: true
8.7 KB
Loading
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
_quarto:
3+
tests:
4+
html:
5+
ensureHtmlElements:
6+
- ['section#preface .quarto-cover-image']
7+
- ['.ligtbox > .quarto-cover-image']
8+
---
9+
10+
# Preface {.unnumbered}
11+
12+
This is a Quarto book. Cover image should not have Lightbox treatment in books when `lightbox: true`
13+
14+
To learn more about Quarto books visit <https://quarto.org/docs/books>.

0 commit comments

Comments
 (0)