From f1fd709ee7b9b182be22cf3de23699da71f080fa Mon Sep 17 00:00:00 2001 From: Paul <36696816+pushfoo@users.noreply.github.com> Date: Mon, 13 Jan 2025 23:25:54 -0500 Subject: [PATCH] doc: lazy load images on resources listing page (#2493) * Add lazy load marker to prevent hitting GitHub raw rate limit (HTTP 429) * Explain why we have the funny :lazy: marker --- util/create_resources_listing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/create_resources_listing.py b/util/create_resources_listing.py index 01c71e8ef..e26bc4e9d 100644 --- a/util/create_resources_listing.py +++ b/util/create_resources_listing.py @@ -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]