How can I add a relative path to an image in my extension? #8724
-
Descriptionrelated post that did not work for me #5694 I have a quarto extension for an html theme and it has images included, along with the images referenced in the custom scss. I have another project that I want to add the extension to. When using /* Add logo to title block margin */
.quarto-title-block .quarto-title-banner {
background-image: url(_extensions/coe-test-org/purpledoc/images/nwpage_tree_logo.png);
background-size: 140px;
background-position: left;
background-repeat: no-repeat;
padding-left: 3%;
background-origin: content-box;
} However, this file path cannot work when rendering the template.qmd or when creating a new project via So, is there no way to reference the image in scss and also use the scss in both This person has a work around that references the github image itself. Is that the only way? https://github.com/pat-alt/quarto-tudelft/blob/b324cee4a6860a5ed5385dc607330d49de052875/_extensions/tudelft/custom.scss#L12 and the inrae extension uses the full extension path including the github-org name. I noticed they don't have a template html, probably because it doesn't erros when rendering https://github.com/davidcarayon/quarto-inrae-extension/blob/main/_extensions/inrae/ressources/beamercolorthemeinrae.sty#L87 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
See #5694 where this has already been discussed (as pointed out). Last option is to use Lua to generate/include the SCSS: |
Beta Was this translation helpful? Give feedback.
See #5694 where this has already been discussed (as pointed out).
And as discussed, there is no great way to do what you want.
Another possibility is to use
resource-path
, see #6526 orformat-resources
, see https://quarto.org/docs/journals/formats.html#format-resources.Last option is to use Lua to generate/include the SCSS:
quarto.doc.add_html_dependency
from https://quarto.org/docs/extensions/lua-api.html#dependencies.