Book Options
All available options for book
projects are documented below. See Creating a Book for an in-depth guide to creating books with Quarto.
Project
Options that define the type, render targets, and output of a project. Project options are specified under the project
key. For example:
---
project:
type: book
output-dir: _book
---
type |
Project type ( |
render |
Files to render (defaults to all files) |
execute-dir |
Control the working directory for computations.
|
output-dir |
Output directory |
lib-dir |
HTML library (JS/CSS/etc.) directory |
resources |
Additional file resources to be copied to output directory |
preview |
Options for |
Preview
Specify options that control the behavior of quarto preview
within the preview
key. For example:
---
project:
type: book
output-dir: _book
preview:
port: 4200
browser: false
---
Available preview
options include:
port |
Port to listen on (defaults to random value between 3000 and 8000) |
host |
Hostname to bind to (defaults to 127.0.0.1) |
browser |
Open a web browser to view the preview (defaults to true) |
watch-inputs |
Re-render input files when they change (defaults to true) |
navigate |
Navigate the browser automatically when outputs are updated (defaults to true) |
timeout |
Time (in seconds) after which to exit if there are no active clients |
Book
Options that affect book output. Book options are specified under the book
key. For example:
---
book:
title: "My Book"
image: opengraph.png
page-navigation: true
---
title |
Book title |
subtitle |
Book subtitle |
author |
Author or authors of the book |
date |
Book publication date |
abstract |
Book abstract |
description |
Description metadata for HTML version of book |
references |
Book references file |
output-file |
Base name for single-file output (e.g. PDF, ePub) |
cover-image |
Cover image (used in HTML and ePub formats) |
sharing |
Sharing buttons to include on navbar or sidebar (one or more of |
downloads |
Download buttons for other formats to include on navbar or sidebar (one or more of |
tools |
Custom tools for navbar or sidebar |
description |
Website description |
favicon |
The path to the favicon for this website |
site-url |
Base URL for published website |
site-path |
Path to site (defaults to |
repo-url |
Base URL for website source code repository |
repo-subdir |
Subdirectory of repository containing website |
repo-branch |
Branch of website source code (defaults to |
repo-actions |
Links to source repository actions ( |
google-analytics |
The Google tracking Id or measurement Id of this website. |
cookie-consent |
The type of consent that should be requested, using one of these two values:
|
search |
Site search ( |
navbar |
Navbar options (see Navbar) |
sidebar |
Sidebar options (see Sidebar) |
body-header |
Markdown to insert at the beginning of each page’s body (below the title and author block). |
body-footer |
Markdown to insert below each page’s body. |
margin-header |
Markdown to place above margin content (text or file path) |
margin-footer |
Markdown to place below margin content (text or file path) |
page-navigation |
Provide next and previous article links in footer |
page-footer |
Page footer. Text content or page footer definition. |
image |
Default site thumbnail image for |
comments |
|
open-graph |
Generate Open Graph metadata (see Open Graph options) |
twitter-card |
Generate Twitter Card metadata (see Twitter Card options) |
Search
Search options are specified under the search
key of book
. For example:
book:
search:
location: navbar
type: overlay
---
location |
Location for search widget ( |
type |
Type of search UI ( |
limit |
Number of matches to display (defaults to 20) |
collapse-after |
Matches after which to collapse additional results |
copy-button |
Provide button for copying search link |
algolia |
Use an Algolia index for site search (see Algolia Options) |
Algolia Options
You can use an Algolia index as the back end of book search. Specify Algolia options using the algolia
sub-key of search
, for example:
---
book:
search:
algolia:
index-name: <my-index-name>
application-id: <my-application-id>
search-only-api-key: <my-search-only-api-key>
---
index-name |
The name of the index to use when performing a search |
application-id |
The unique ID used by Algolia to identify your application |
search-only-api-key |
The Search-Only API key to use to connect to Algolia |
analytics-events |
Enable tracking of Algolia analytics events |
show-logo |
Enable the display of the Algolia logo in the search results footer. |
index-fields |
Fields to target for searches (see below for details) |
params |
Additional parameters to pass when executing a search |
The index-fields
option provides sub-fields within the Algolia index to target for searches:
href |
Field that contains the URL of index entries |
title |
Field that contains the title of index entries |
text |
Field that contains the text of index entries |
section |
Field that contains the section of index entries |
Listings
Listings enable you to automatically generate the contents of a page (or region of a page) from a list of Quarto documents or other custom data. You can enable listings on a page using the listing
option in the document front matter, for example:
---
title: "Listing Example"
listing: default
---
id |
The id of this listing. When the listing is rendered, it will place the contents into a In no |
type |
The type of listing to create. Choose one of:
|
contents |
The files or path globs of Quarto documents or YAML files that should be included in the listing. |
sort |
Sort items in the listing by these fields. The sort key is made up of a field name followed by a direction For example: |
max-items |
The maximum number of items to include in this listing. |
page-size |
The number of items to display on a page. |
sort-ui |
Shows or hides the sorting control for the listing. To control the fields that will be displayed in the sorting control, provide a list of field names. |
filter-ui |
Shows or hides the filtering control for the listing. To control the fields that will be used to filter the listing, provide a list of field names. By default all fields of the listing will be used when filtering. |
categories |
Display item categories from this listing in the margin of the page.
|
feed |
Create an RSS feed for this page using the items in this listing (see Feed). |
date-format |
The date format to use when displaying dates (e.g. d-M-yyy). Learn more about supported date formatting values here. |
max-description-length |
The maximum length (in characters) of the description displayed in the listing. Defaults to 175. |
image-placeholder |
The default image to use if an item in the listing doesn’t have an image. |
image-align |
In |
image-height |
The height of the image being displayed (a CSS height string). The width is automatically determined and the image will fill the rectangle without scaling (cropped to fill). |
grid-columns |
In grid type listings, the number of columns in the grid display. Defaults to 3. |
grid-item-border |
In grid type listings, whether to display a border around the item card. Defaults to |
grid-item-align |
In grid type listings, the alignment of the content within the card ( |
table-striped |
In table type listings, display the table rows with alternating background colors. Defaults to |
table-hover |
In table type listings, highlight rows of the table when the user hovers the mouse over them. Defaults to false. |
template |
The path to a custom listing template. |
fields |
The list of fields to include in this listing. |
field-display-names |
A mapping that provides display names for specific fields. For example, to display the title column as ‘Report’ in a table listing you would write:
|
field-types |
Provides the date type for the field of a listing item. Unknown fields are treated as strings unless a type is provided. Valid types are |
field-links |
The list of fields to display as hyperlinks to the source document when the listing type is a table. By default, only the |
field-required |
Fields that items in this listing must have populated. If a listing is rendered and one more items in this listing is missing a required field, an error will occur and the render will. |
Feed
Enable an RSS feed for your listing by including the feed
option.
items |
The number of items to include in your feed. Defaults to 20. |
type |
Whether to include full or partial content in the feed.
|
title |
The title for this feed. Defaults to the site title provided the Quarto project. |
image |
The path to an image for this feed. If not specified, the image for the page the listing appears on will be used, otherwise an image will be used if specified for the site in the Quarto project. |
description |
The description of this feed. If not specified, the description for the page the listing appears on will be used, otherwise the description of the site will be used if specified in the Quarto project. |
language |
The language of the feed. Omitted if not specified. See https://www.rssboard.org/rss-language-codes for a list of valid language codes. |
categories |
A list of categories for which to create separate RSS feeds containing only posts with that category. |
About
Layout a simple about page for an individual or organization. For more, see the About Pages documentation.
id |
The target id of this about page. When the about page is rendered, it will place read the contents of a If no such |
template |
The template to use to layout this about page. Choose from:
|
image |
The path to the main image on the about page. If not specified, the |
image-width |
A valid CSS width for the about page image. |
image-shape |
The shape of the image on the about page.
|
links |
Links (as navigation items) to display on the about page. |
Comments
You can add commenting to your book using either Hypothesis or Utterances.
Hypothesis
Enable and configure Hypothesis commenting via
comments
key. For example:openSidebar
Controls whether the sidebar opens automatically on startup.
showHighlights
Controls whether the in-document highlights are shown by default (
always
ornever
)theme
Controls the overall look of the sidebar (
classic
orclean
)enableExperimentalNewNoteButton
Controls whether the experimental New Note button should be shown in the notes tab in the sidebar.
usernameUrl
Specify a URL to direct a user to, in a new tab. when they click on the annotation author link in the header of an annotation.
services
Array of service definitions
branding
Custom branding/colors to apply to UI
externalContainerSelector
A CSS selector specifying the containing element into which the sidebar iframe will be placed.
focus
User focused filter set for the available annotations on a page
requestConfigFromFrame
Speicfy a host iframe to request configuration from
assetRoot
The root URL from which assets are loaded.
sidebarAppUrl
The URL for the sidebar application which displays annotations.
For additional documentation on the Hypothesis options enumerated above, see the Hypothesis Publisher Config documentation.
Utterances
Enable and configure Utterances commenting via the
comments
key. For example:repo
The Github repo that will be used to store comments.
label
The label that will be assigned to issues created by Utterances.
theme
The Github theme that should be used for Utterances (
github-light
,github-dark
,github-dark-orange
,icy-dark
,dark-blue
,photon-dark
,body-light
, orgruvbox-dark
)issue-term
How posts should be mapped to Github issues (
pathname
,url
,title
orog:title
)Giscus
Enable and configure usage of the Giscus app via the
comments
key. For example:repo
The Github repo that will be used to store comments.
In order to work correctly, the repo must be public, with the giscus app installed, and the discussions feature must be enabled.
repo-id
The Github repository identifier.
You can quickly find this by using the configuration tool at https://giscus.app. If this is not provided, Quarto will attempt to discover it at render time.
category
The discussion category where new discussions will be created. It is recommended to use a category with the Announcements type so that new discussions can only be created by maintainers and giscus.
category-id
The Github category identifier.
You can quickly find this by using the configuration tool at https://giscus.app. If this is not provided, Quarto will attempt to discover it at render time.
mapping
The mapping between the page and the embedded discussion.
pathname
: The discussion title contains the page pathurl
: The discussion title contains the page urltitle
: The discussion title contains the page titleog:title
: The discussion title contains theog:title
metadata valuereactions-enabled
Display reactions for the discussion’s main post before the comments.
input-position
Place the comment input box above or below the comments.
theme
The giscus theme to use when displaying comments.
language
The language that should be used when displaying the commenting interface.