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

Option to disable default image functionality #5251

Closed
seeM opened this issue Apr 20, 2023 · 10 comments
Closed

Option to disable default image functionality #5251

seeM opened this issue Apr 20, 2023 · 10 comments
Assignees
Labels
enhancement New feature or request good-first-issue Good for newcomers, fairly well defined websites Issues creating websites
Milestone

Comments

@seeM
Copy link

seeM commented Apr 20, 2023

Apologies if I'm missing something, but there doesn't seem to be a way to disable Quarto from setting the image of a post to the first image. I was thinking of something like setting image: null in the post metadata.

@cderv
Copy link
Collaborator

cderv commented Apr 20, 2023

If you are referring to social preview, same as your question in Discussion, you can configure this in some settings https://quarto.org/docs/reference/projects/websites.html#social

If you are referring to listing feature, we have some information at https://quarto.org/docs/websites/website-listings.html#listing-fields to change the image

Or do you want no image at all ?

@seeM
Copy link
Author

seeM commented Apr 20, 2023

Yes, I would like no image at all

@cderv
Copy link
Collaborator

cderv commented Apr 20, 2023

Yes, I would like no image at all

No image at all where ? in a Listing page ? In social preview ?

@seeM
Copy link
Author

seeM commented Apr 20, 2023 via email

@allenmanning allenmanning added enhancement New feature or request blogs labels Apr 20, 2023
@dragonstyle
Copy link
Collaborator

Right now I don't think there is a way to disable this - the auto discovery is always finding an image.

We have a couple of options:

  • We could relax the auto-discovery (as it was previous versions) so it less frequently finds preview images (e.g. the older versions required specific file names, class names, or document metadata to count as preview images). This old was was changed to make it easier to use computational images as preview images, so I'm loathe to go back.
  • We could support image: false in the front matter as a way to disable preview image discovery. I'm in favor of this.

@dragonstyle dragonstyle added this to the v1.4 milestone Apr 20, 2023
@dragonstyle dragonstyle self-assigned this Apr 20, 2023
@dragonstyle dragonstyle added the good-first-issue Good for newcomers, fairly well defined label Apr 20, 2023
@seeM
Copy link
Author

seeM commented Apr 21, 2023

Thanks @dragonstyle! I agree on the image: false option. I don't think it's worth rolling back the auto-discovery feature just for this option

@nsfinkelstein
Copy link

nsfinkelstein commented Feb 12, 2024

Using the image: false option has produced the following error for me, under Quarto version 1.4.549

ERROR: TypeError: path.startsWith is not a function

Stack trace:
    at listingItemHref (file:///opt/quarto/bin/quarto.js:89130:37)
    at listItemFromFile (file:///opt/quarto/bin/quarto.js:88951:71)
    at eventLoopTick (ext:core/01_core.js:183:11)
    at async readContents (file:///opt/quarto/bin/quarto.js:88780:34)
    at async readListings (file:///opt/quarto/bin/quarto.js:88416:36)
    at async listingHtmlDependencies (file:///opt/quarto/bin/quarto.js:90080:45)
    at async Object.formatExtras (file:///opt/quarto/bin/quarto.js:90400:45)
    at async runPandoc (file:///opt/quarto/bin/quarto.js:68741:63)
    at async renderPandoc (file:///opt/quarto/bin/quarto.js:70041:26)
    at async Object.onRender (file:///opt/quarto/bin/quarto.js:77261:36)

I was able to disable images in the listing by setting image-height: "0" in the listing options.

@cscheid
Copy link
Collaborator

cscheid commented Feb 12, 2024

@nsfinkelstein We need a reproducible document to test.

@nsfinkelstein
Copy link

nsfinkelstein commented Feb 12, 2024

Thanks for the response. I am happy with the approach of setting image-height: "0" in the listing options, so I don't mean to ask that the issue be reopened. I just wanted to share that approach with anyone else who happens upon the same error and github issues I did.

@dragonstyle
Copy link
Collaborator

I can reproduce this (image: false was initially intended to affect editing image metadata on the page, but it should work in this context too). Here's that issue:

#8715

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good-first-issue Good for newcomers, fairly well defined websites Issues creating websites
Projects
None yet
Development

No branches or pull requests

6 participants