Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track resources inside styles #7470

Open
cscheid opened this issue Nov 3, 2023 · 12 comments
Open

Track resources inside styles #7470

cscheid opened this issue Nov 3, 2023 · 12 comments
Labels
bug Something isn't working html Issues with HTML and related web technology (html/css/scss)
Milestone

Comments

@cscheid
Copy link
Collaborator

cscheid commented Nov 3, 2023

This should work without requiring users to add images/image.jpg to resources:

---
title: "Title"
---

:::{style="background-image: url('images/image.jpg');"}

This is a Quarto website.

To learn more about Quarto websites visit <https://quarto.org/docs/websites>.


:::
@cscheid cscheid added this to the v1.5 milestone Nov 3, 2023
@cscheid cscheid added the bug Something isn't working label Nov 3, 2023
@cderv
Copy link
Collaborator

cderv commented Nov 3, 2023

Just for context so that we don't forgot:
This works in a single document, but should work when using output-dir with a Project like websites so that resources are found and moved without needing to add

resources:
  - images/image.jpg

@coatless
Copy link
Contributor

coatless commented Nov 3, 2023

I think this is also related to #6828 not adding registered assets to resources as well. (Note, this happens even with the publish quarto action.)

@produnis
Copy link

produnis commented Jan 1, 2024

I get these warnings, and it does not work...

---
(...)
  resources:
    - HSNRtheme/fonts/Roboto-Mono-regular.woff2
    - HSNRtheme/fonts/Vollkorn-Bold.woff2
    - HSNRtheme/fonts/Vollkorn-BoldItalic.woff2
    - HSNRtheme/fonts/Vollkorn-Italic.woff2
    - HSNRtheme/fonts/Vollkorn-Regular.woff2
    - HSNRtheme/fonts/TannenbergFett.woff2
---
  
[WARNING] Could not fetch resource Folientest_files/libs/revealjs/dist/theme/fonts/Vollkorn-Regular.woff2
[WARNING] Could not fetch resource Folientest_files/libs/revealjs/dist/theme/fonts/TannenbergFett.woff2
[WARNING] Could not fetch resource Folientest_files/libs/revealjs/dist/theme/fonts/Roboto-Mono-regular.woff2
[WARNING] Could not fetch resource Folientest_files/libs/revealjs/dist/theme/fonts/TannenbergFett.woff2
[WARNING] Could not fetch resource Folientest_files/libs/revealjs/dist/theme/fonts/Vollkorn-Italic.woff2
[WARNING] Could not fetch resource Folientest_files/libs/revealjs/dist/theme/fonts/Vollkorn-Bold.woff2
[WARNING] Could not fetch resource Folientest_files/libs/revealjs/dist/theme/fonts/Vollkorn-BoldItalic.woff2
Output created: Folientest.html

@mcanouil
Copy link
Collaborator

mcanouil commented Jan 1, 2024

@produnis please provide a reproducible example and not just error/warning messages with "it's not working". There is not much we can do with these. Thank you for your understanding and help.

@cderv
Copy link
Collaborator

cderv commented Jan 3, 2024

@produnis it would be nice to open a new issue too, as it is possibly another bug (related) as you provided resources in YAML

This issue is about supporting auto-detection of some resources. Related but not the same, and it is best practice to keep issue thread scoped.

Thank you

@produnis
Copy link

produnis commented Jan 3, 2024

I uploaded a minimal example to here:
https://hs-niederrhein.sciebo.de/s/N27QYgbfXrJJHoZ
https://github.com/produnis/quartofonttes

See "Folientest.qmd" as the example...

I would like to create a stand-alone-html that I could share with students. The main font should be "Vollkorn" and the Monofont should be Roboto Mono.

@mcanouil
Copy link
Collaborator

mcanouil commented Jan 3, 2024

What is that link? Could you share a Git repository, for example on GitHub?

@coatless
Copy link
Contributor

coatless commented Jan 3, 2024

@produnis thanks for sharing an MWE. I think you're getting bitten by a different bug related to how assets are placed relative to access requests in SCSS. c.f. #5712 and #5694.

The "fix" here is to use a relative path to the asset. You can see the tweak I made here: coatless-quarto/illinois-revealjs@c2eae8c The SCSS url designation needs to navigate to the fonts/ folder using relative paths. If you'd like, I can throw together the fix inside a quarto revealjs format.

@produnis
Copy link

produnis commented Jan 3, 2024

Thx for your answers,

I created a github repo here:
https://github.com/produnis/quartofonttes

I tried to set relative paths, but it does not work...

@produnis
Copy link

produnis commented Jan 3, 2024

Ha, @coatless , thx for the hint with relatives paths. Inserting five ../ did the job. Now it is working!

@coatless
Copy link
Contributor

coatless commented Jan 3, 2024

@produnis setup the hrns-revealjs theme for you over here:

https://github.com/coatless-quarto/hsnr-revealjs

https://quarto.thecoatlessprofessor.com/hsnr-revealjs/

Outside of the relative paths, the RevealJS theme is now a quarto extension that avoids typing out a lot of the same details again and again. You can see how the theme was made by looking at the commit steps in the PR:

https://github.com/coatless-quarto/hsnr-revealjs/pull/1/commits

Note: This omits a terminal command of quarto publish gh-pages to set up the gh-pages branch and publish details.

If you have more questions about the extension, let's take it over to the issue tracker in that repository.

@produnis
Copy link

produnis commented Jan 3, 2024

wow, thx @coatless , this helps me a lot understanding "theme as an extension"!

@cscheid cscheid modified the milestones: v1.5, Future Jun 17, 2024
@cscheid cscheid added the html Issues with HTML and related web technology (html/css/scss) label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working html Issues with HTML and related web technology (html/css/scss)
Projects
None yet
Development

No branches or pull requests

5 participants