Skip to content

Commit

Permalink
doc: lazy load images on resources listing page (#2493)
Browse files Browse the repository at this point in the history
* Add lazy load marker to prevent hitting GitHub raw rate limit (HTTP 429)

* Explain why we have the funny :lazy: marker
  • Loading branch information
pushfoo authored Jan 14, 2025
1 parent d71ea18 commit f1fd709
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion util/create_resources_listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,12 @@ def process_resource_files(out, file_list: List[Path]):
# IMPORTANT:
# 1. 11 chars to match the start of "image" above
# 2. :class: checkered-bg to apply the checkers to transparent images
out.write(f" :class: checkered-bg\n\n")
out.write(f" :class: checkered-bg\n")
# 3. :loading: lazy stops GitHub 429ing us ("chill pls") # pending: stop using GH raw as a CDN
out.write(f" :loading: lazy\n")
out.write("\n")
out.write(f" {name}\n")

elif suffix in SUFFIX_TO_AUDIO_TYPE:
file_path = FMT_URL_REF_EMBED.format(resource_path)
src_type=SUFFIX_TO_AUDIO_TYPE[suffix]
Expand Down

0 comments on commit f1fd709

Please sign in to comment.