Skip to content

page body not included in contentIndex.json without the description plugin #2268

@fnitp

Description

@fnitp

Describe the bug

If the description plugin is turned off, the ContentIndex plugin doesn't print page bodies into static/contentIndex.json. ContentIndex gets the page bodies from data.text of each page's VFile, but data.text is only set if the description plugin runs.

This leads to full-text search not working without the description plugin.

To Reproduce
Steps to reproduce the behavior:

  1. set up a default Quartz: git clone https://github.com/jackyzha0/quartz; cd ./quartz; npm i
  2. comment out the Description plugin in quartz.config.ts
  3. build the Quartz: npx quartz build -d ./docs
  4. cat public/static/contentIndex.json
  5. the "content" fields are empty

Search not working:

  1. view the webpage: npx quartz build --serve -d ./docs
  2. in the search bar, enter a term that only appears in text bodies, e.g. "student", "teacher" from the front page
  3. no search results.

Expected behavior
contentIndex.json would include page bodies, even if the description plugin is turned off.

Desktop (please complete the following information):

  • Quartz Version: v4.5.2
  • node Version: v22.16.0
  • npm version: v11.4.2
  • OS: Linux Mint
  • Browser: Firefox

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions