How (where) can I set `search: false` for quarto book (but not for quarto website)?

I cannot find how / where I can set search: false for book (RStudio.app, File > New Project... > New Directory > Quarto Book). How (where) can I do that?

On Quarto Website, I could do it with following yaml as indicated at Website Search

website:
  search: false

I would like to use nice-looking well-organized quarto book style, and am trying to write my own memo in quarto book format to share with colleagues (as well as for my own future reference document).

I'd like to use the rendered html files as local file, without rendering the qmd file to start local web server. I mean I (or colleagues) just open the local _book/index.html on a browser like Safari or Chrome as file://<dirpath>/_book/index.html but not as like http://localhost:4287/index.html.

Sadly, website search functionality is only available on the latter.

So I want to totally remove the search cell with a magnifying icon from the rendered html file.

I found search: false works for website search (RStudio.app, File > New Project... > New Directory > Quarto Website), but I cannot find how / where can I set search: false for book (RStudio.app, File > New Project... > New Directory > Quarto Book).

  • Three cases where I put search: false elsewhere for Quarto Book that didn't work:
    • In _quarto.yml,
project:
  type: book

book:
  title: "report_book_search"
  author: "Norah Jones"
  date: "5/17/2024"
  chapters:
    - index.qmd
    - intro.qmd
    - summary.qmd
    - references.qmd

bibliography: references.bib

format:
  html:
    theme: cosmo
    search: false
  pdf:
    documentclass: scrreprt
project:
  type: book

book:
  title: "report_book_search"
  author: "Norah Jones"
  date: "5/17/2024"
  chapters:
    - index.qmd
    - intro.qmd
    - summary.qmd
    - references.qmd

bibliography: references.bib

format:
  html:
    theme: cosmo
  pdf:
    documentclass: scrreprt

website:
  search: false
project:
  type: book

book:
  title: "report_book_search"
  author: "Norah Jones"
  date: "5/17/2024"
  chapters:
    - index.qmd
    - intro.qmd
    - summary.qmd
    - references.qmd

bibliography: references.bib

format:
  html:
    theme: cosmo
    website:
      search: false
  pdf:
    documentclass: scrreprt

  • Quarto Website where search: false works:
    • In _quarto.yml,
website:
  title: "website_search"
  navbar:
    left:
      - href: index.qmd
        text: Home
      - about.qmd
  search: false

Without search: false, the icon appears at top right.

With search: false, it disappears as expected.

Solved, thanks:

  • Adding search: false under book: makes the html without the search cell.

  • At Book Options > Search, it describes as 'Search options are specified under the search key of book.'

  • In _quarto.yml,

project:
  type: book

book:
  title: "report_book_search"
  author: "Norah Jones"
  date: "5/17/2024"
  chapters:
    - index.qmd
    - intro.qmd
    - summary.qmd
    - references.qmd
  search: false

bibliography: references.bib

format:
  html:
    theme: cosmo
  pdf:
    documentclass: scrreprt

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

Just a note that if you don't serve using a web server, it is possible that some features won't work. (like OJS or other features requires files to be served). You may not be encountering this problem, but just preferred to warn you.

Though, search feature is possibly one of this requiring file to be served for the JS to work properly.