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

docs: lazy-load images #17565

Merged

Conversation

HonkingGoose
Copy link
Collaborator

Changes

  • Lazy-load more images 1

Context

We're already using this feature in the Swissquote article. But there are more images that we should lazily load.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

Footnotes

  1. https://squidfunk.github.io/mkdocs-material/reference/images/#image-lazy-loading

@rarkins
Copy link
Collaborator

rarkins commented Sep 1, 2022

  1. I have some concerns that this messes up the regular markdown rendering of these files
  2. Not related to this PR, but I saw that some of these images work when viewing on github and some don't (e.g. /assets with leading slash)

@HonkingGoose
Copy link
Collaborator Author

HonkingGoose commented Sep 2, 2022

  1. The lazy load directive text will show up on the GitHub preview for these Markdown files. You can even see this in the PR preview, once you click on the "rich diff" button. See how the text for the directive is shown right next to the image.
  2. Its weird how some images display properly, and others don't, in the GitHub preview. I don't know how to fix this. 🙈

It would be nice if Material for MkDocs could just lazy-load all images by default, without us adding that lazy-load directive. Unfortunately this is not yet possible according to the maintainer:

@rarkins rarkins merged commit 12f643d into renovatebot:main Sep 2, 2022
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 32.188.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@HonkingGoose HonkingGoose deleted the docs/use-lazy-loading-for-images branch September 2, 2022 18:33
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants