Skip to content
Open
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
8 changes: 8 additions & 0 deletions news/changelog-1.11.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ All changes included in 1.11:

- ([#14847](https://github.com/quarto-dev/quarto-cli/pull/14847)): Fix `toc_title` auto-fallback in typst outline template that was ignoring the computed fallback value when `toc_title` is `none`.

## Projects

### Books

- ([#10114](https://github.com/quarto-dev/quarto-cli/issues/10114)): Support `announcement` under the `book` key, which previously had no effect.
- ([#14276](https://github.com/quarto-dev/quarto-cli/issues/14276)): Support `llms-txt` under the `book` key, which previously had no effect.
- ([#14879](https://github.com/quarto-dev/quarto-cli/issues/14879)): Support `plausible-analytics`, `back-to-top-navigation`, and `image-alt` under the `book` key, which previously had no effect.

## Commands

### `call`
Expand Down
10 changes: 10 additions & 0 deletions src/project/types/book/book-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ import {
import { kProjectRender, ProjectConfig } from "../../types.ts";

import {
kAnnouncement,
kBackToTopNavigation,
kBodyFooter,
kBodyHeader,
kBreadCrumbNavigation,
kContents,
kImage,
kImageAlt,
kLlmsTxt,
kMarginFooter,
kMarginHeader,
kOpenGraph,
Expand Down Expand Up @@ -114,6 +118,7 @@ import {
import {
kCookieConsent,
kGoogleAnalytics,
kPlausibleAnalytics,
} from "../website/website-analytics.ts";
import { RenderFlags } from "../../../command/render/types.ts";
import { formatLanguage } from "../../../core/language.ts";
Expand Down Expand Up @@ -162,14 +167,19 @@ export async function bookProjectConfig(
site[kOpenGraph] = book[kOpenGraph];
site[kTwitterCard] = book[kTwitterCard];
site[kImage] = book[kImage];
site[kImageAlt] = book[kImageAlt];
site[kMarginHeader] = book[kMarginHeader];
site[kMarginFooter] = book[kMarginFooter];
site[kBodyHeader] = book[kBodyHeader];
site[kBodyFooter] = book[kBodyFooter];
site[kBookSearch] = book[kBookSearch];
site[kSiteReaderMode] = book[kSiteReaderMode];
site[kGoogleAnalytics] = book[kGoogleAnalytics];
site[kPlausibleAnalytics] = book[kPlausibleAnalytics];
site[kCookieConsent] = book[kCookieConsent];
site[kAnnouncement] = book[kAnnouncement];
site[kBackToTopNavigation] = book[kBackToTopNavigation];
site[kLlmsTxt] = book[kLlmsTxt];
site[kComments] = book[kComments];
site[kBreadCrumbNavigation] = book[kBreadCrumbNavigation];
site[kOtherLinks] = book[kOtherLinks];
Expand Down
3 changes: 3 additions & 0 deletions tests/docs/smoke-all/book/announcement/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.quarto/
/_book/
**/*.quarto_ipynb
14 changes: 14 additions & 0 deletions tests/docs/smoke-all/book/announcement/_quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
project:
type: book

book:
title: "Announcement Book"
announcement:
content: "Some information you should pay attention to"
type: primary
chapters:
- index.qmd

format:
html:
theme: cosmo
13 changes: 13 additions & 0 deletions tests/docs/smoke-all/book/announcement/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
_quarto:
tests:
html:
ensureHtmlElements:
-
- 'div#quarto-announcement.alert-primary div.quarto-announcement-content'
---

# Preface {.unnumbered}

An announcement configured under the `book` key must render the announcement
bar in the book website output.
3 changes: 3 additions & 0 deletions tests/docs/smoke-all/book/back-to-top-navigation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.quarto/
/_book/
**/*.quarto_ipynb
12 changes: 12 additions & 0 deletions tests/docs/smoke-all/book/back-to-top-navigation/_quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
project:
type: book

book:
title: "Back To Top Book"
back-to-top-navigation: true
chapters:
- index.qmd

format:
html:
theme: cosmo
13 changes: 13 additions & 0 deletions tests/docs/smoke-all/book/back-to-top-navigation/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
_quarto:
tests:
html:
ensureHtmlElements:
-
- 'a#quarto-back-to-top[role="button"]'
---

# Preface {.unnumbered}

`back-to-top-navigation` under the `book` key must add the back to top control
to the book website output.
3 changes: 3 additions & 0 deletions tests/docs/smoke-all/book/image-alt/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.quarto/
/_book/
**/*.quarto_ipynb
16 changes: 16 additions & 0 deletions tests/docs/smoke-all/book/image-alt/_quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
project:
type: book

book:
title: "Image Alt Book"
site-url: "https://example.com"
open-graph: true
twitter-card: true
image: cover.png
image-alt: "A description of the preview image"
chapters:
- index.qmd

format:
html:
theme: cosmo
Binary file added tests/docs/smoke-all/book/image-alt/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/book/image-alt/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
_quarto:
tests:
html:
ensureHtmlElements:
-
- 'meta[property="og:image:alt"][content="A description of the preview image"]'
- 'meta[name="twitter:image:alt"][content="A description of the preview image"]'
---

# Preface {.unnumbered}

`image-alt` under the `book` key must set the alt text on the social metadata
preview image.
3 changes: 3 additions & 0 deletions tests/docs/smoke-all/book/llms-txt/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.quarto/
/_book/
**/*.quarto_ipynb
13 changes: 13 additions & 0 deletions tests/docs/smoke-all/book/llms-txt/_quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
project:
type: book

book:
title: "llms-txt Book"
site-url: "https://example.com"
llms-txt: true
chapters:
- index.qmd

format:
html:
theme: cosmo
16 changes: 16 additions & 0 deletions tests/docs/smoke-all/book/llms-txt/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
_quarto:
render-project: true
tests:
html:
ensureLlmsTxtExists: true
ensureLlmsMdExists: true
ensureLlmsTxtRegexMatches:
- ['^# llms-txt Book', '^## Pages', '\[.*\]\(.*\.llms\.md\)']
- []
---

# Preface {.unnumbered}

`llms-txt` set under the `book` key must generate the llms.txt index, the same
way it does under `website`.
3 changes: 3 additions & 0 deletions tests/docs/smoke-all/book/plausible-analytics/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.quarto/
/_book/
**/*.quarto_ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<script async src="https://plausible.io/js/pa-BOOKFILE99.js"></script>
13 changes: 13 additions & 0 deletions tests/docs/smoke-all/book/plausible-analytics/_quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
project:
type: book

book:
title: "Plausible Analytics Book"
chapters:
- index.qmd
plausible-analytics:
path: _plausible_snippet.html

format:
html:
theme: cosmo
13 changes: 13 additions & 0 deletions tests/docs/smoke-all/book/plausible-analytics/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
_quarto:
tests:
html:
ensureHtmlElements:
-
- 'script[async][src="https://plausible.io/js/pa-BOOKFILE99.js"]'
---

# Preface {.unnumbered}

Plausible Analytics configured under the `book` key must be applied to the
rendered book website, the same way `google-analytics` is.
2 changes: 2 additions & 0 deletions tests/docs/smoke-all/website/llms-txt-drafts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
*.html
*.llms.md
llms.txt
search.json
site_libs/
*_files/

**/*.quarto_ipynb
2 changes: 2 additions & 0 deletions tests/docs/smoke-all/website/llms-txt-listing/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
*.html
*.llms.md
llms.txt
search.json
site_libs/
*_files/

**/*.quarto_ipynb
Loading