Fix/lqip and template#47
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates site templates and client-side utilities to improve offline UX, theme prepaint behavior, and harden a couple of build/scripts flows.
Changes:
- Reworked
offline.htmlto extendbase.htmldirectly (rail layout parity) and addedrobotsmeta. - Adjusted head rendering (font handling, Ahrefs consolidation, and attempted deferred CSS loading) plus improved theme prepaint class assignment.
- Hardened project sync + sitemap cleanup scripts, and improved offline reconnect behavior via periodic polling.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
templates/offline.html |
Switches to base.html layout and refines offline page head/content. |
templates/macros/head.html |
Refactors font/Ahrefs handling and changes stylesheet loading strategy. |
static/js/system/offline-reload.js |
Adds interval-based recovery checks in addition to the online event. |
static/js/features/access-keys.js |
Changes semantic hint behavior for links inside the TOC sidebar. |
static/js/core/boot.js |
Adds early html.light/html.dark class to reduce prepaint flicker. |
scripts/sync-project-data.js |
Tightens GitHub URL parsing and constrains outbound API requests to GitHub. |
scripts/clean-pagination-redirects.js |
Writes sitemap updates atomically via temp-file + rename. |
Comment on lines
+224
to
+229
| <link rel="stylesheet" href="{{ get_url(path="css/lqip.css") | safe }}" media="print" onload="this.media='all'; this.onload=null;"> | ||
| <link rel="stylesheet" href="{{ get_url(path="css/font-awesome.subset.css") | safe }}" media="print" onload="this.media='all'; this.onload=null;"> | ||
| <noscript> | ||
| <link rel="stylesheet" href="{{ get_url(path="css/lqip.css") | safe }}"> | ||
| <link rel="stylesheet" href="{{ get_url(path="css/font-awesome.subset.css") | safe }}"> | ||
| </noscript> |
Comment on lines
+374
to
+396
| // Semantic rules — normally skip TOC sidebar because those are | ||
| // page-internal anchors that must not inherit site-nav shortcuts. | ||
| // However, some TOC entries are site-level links (e.g. /archive/, /about/) | ||
| // and should still receive their semantic shortcuts. Detect those by | ||
| // allowing semantic-rule matching for anchors that point to a same-origin | ||
| // pathname with no hash (i.e. true site nav links), even when inside the | ||
| // TOC sidebar. | ||
| const inToc = !!el.closest("[data-toc-sidebar]"); | ||
| let allowSemanticInToc = false; | ||
| if (el.tagName === "A" && el.href) { | ||
| try { | ||
| const u = new URL(el.href, window.location.origin); | ||
| // same-origin and no fragment/hash | ||
| if (u.origin === window.location.origin && !u.hash) { | ||
| // treat shallow site nav paths as nav links (e.g. /about/, /archive/) | ||
| const segments = u.pathname.replace(/(^\/|\/$)/g, "").split("/"); | ||
| // allow 0 (root) or 1-segment paths to be treated as site links | ||
| if (segments.length <= 1) allowSemanticInToc = true; | ||
| } | ||
| } catch (e) { | ||
| allowSemanticInToc = false; | ||
| } | ||
| } |
Comment on lines
+92
to
+98
| // Periodic polling: keep checking network status every POLL_INTERVAL_MS | ||
| // even if 'online' event doesn't fire. This ensures recovery on reconnect. | ||
| pollInterval = setInterval(function () { | ||
| if (navigator.onLine) { | ||
| maybeRecover(); | ||
| } | ||
| }, POLL_INTERVAL_MS); |
279e00e to
42ea8a1
Compare
Owner
Author
|
@copilot apply changes based on the comments in this thread |
Copilot stopped work on behalf of
kascit due to an error
May 11, 2026 14:28
Owner
Author
|
@copilot apply changes based on the comments in this thread |
Copilot stopped work on behalf of
kascit due to an error
May 11, 2026 14:31
b4628a7 to
74eada9
Compare
74eada9 to
8385a3f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.