fastpages icon indicating copy to clipboard operation
fastpages copied to clipboard

Support webp images in notebooks

Open stefanbschneider opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

I'm measuring my page performance with web.dev and it tells me to convert my images in the webp format, which is more modern and typically leads to smaller files, which can be loaded faster.

Adding (manually converted) webp images in HTML works like this (copied from StackOverflow):

<picture>
  <source srcset="img.webp" type="image/webp">
  <source srcset="img.jpg" type="image/jpeg"> 
  <img src="img.jpg">
</picture>

This works in Markdown posts, but it does not work in Jupyter notebooks, which make up a relevant portion of my blog posts with fastpages.

My understanding is that fastpages copies images used in notebooks to /images/copied_from_nb/. Apparently it does not copy webp pages though and such that the HTML snippet above does not work for notebooks.


**Describe the solution you'd like**

I want fastpages to also copy webp images/videos from notebooks to `/images/copied_from_nb` automatically.
At least make it easily configurable, which file formats are copied automatically. I couldn't find anything related.

**Describe alternatives you've considered**

I looked at `_action_files/settings.ini`, which seems to hold the path `/images/copied_from_nb` to where images are copied. But I could not find any setting that would allow me to include webp images.

Or am I missing something here and webp images are copied correctly but not displayed for other reasons? Does anyone have experience with this?

Maybe even with automating this, eg, using jekyll-webp? I tried it but did not get it to work with fastpages.

stefanbschneider avatar Dec 30 '21 15:12 stefanbschneider

Thank you for opening an issue. If this issue is related to a bug, please follow the steps and provide the information outlined in the Troubleshooting Guide. Failure to follow these instructions may result in automatic closing of this issue.

github-actions[bot] avatar Dec 30 '21 15:12 github-actions[bot]

NB: I am writing this comment on all open issues

Thank you for posting this issue, and I'm really sorry I haven't gotten around to fixing this. All of my time has been focused on nbdev. In the new version of nbdev, we knew that we wanted to include blogging rather than it being a separate project. We realized that Quarto, which the new version of nbdev is built on, is much better than fastpages. Rather than keep this project going, we are recommending that people migrate to Quarto as we think that will be more powerful for users and is a much better tool for blogging.

I've written a detailed migration guide with some tools that will hopefully make the process of switching much easier. Overall I think it will be worth it for users.

My apologies again for not getting to this issue sooner. Will close this issue with this PR https://github.com/fastai/fastpages/pull/657, where we are letting people know that we are deprecating this project. Thanks again for your support and for using fastpages! 🙇🏽

hamelsmu avatar Sep 16 '22 00:09 hamelsmu