quarto-dev / quarto-dev/quarto-cli

`background-image` not embedded when `embed-resources: true`

Open
#980 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement revealjs
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

it appears that the background-image is never embedded in the html file for some reason.
If the background image is set with {background-image="assets/background.jpg"}, it is embedded.

The following setup in the yaml, will result in slides without background.
While, it's working fine when the generated html is at the same level as the qmd file it comes from.

format:
  revealjs:
    embed-resources: true
    background-image: background.jpg
    output-file: docs/index.html

The image path is not replaced by a the base64 version of the image.
From the HTML file generated:

      // Parallax background image
       parallaxBackgroundImage: 'background.jpg',

Example: https://github.com/mcanouil/quarto-issues/tree/main/quarto-cli%23980
Version: 0.9.449
Originally from: quarto-dev/quarto-cli#951

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked quarto-issues#980 reproduction and its YAML configuration, comparing output when index.html is nested under docs/ with output at the qmd level. Trace the revealjs handling of embed-resources and background-image, then verify that the generated parallaxBackgroundImage uses an embedded base64 image in both locations.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.