mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2026-06-21 23:38:39 +00:00
ceb2a41463
Previously, theme switch events were lost if triggered before the Giscus iframe was fully loaded (e.g., when deferred by lazy loading or before the client script executed). This resulted in Giscus rendering with the outdated initial theme once it finally appeared in the viewport. This commit handles these edge cases by: 1. Updating the `data-theme` attribute on the Giscus script node if the iframe hasn't been created yet. 2. Modifying the `theme` query parameter in the iframe's `src` URL if it is currently in a pending/lazy-loading state.