Skip to content

Fix/lqip and template#47

Merged
kascit merged 6 commits into
mainfrom
fix/lqip-and-template
May 11, 2026
Merged

Fix/lqip and template#47
kascit merged 6 commits into
mainfrom
fix/lqip-and-template

Conversation

@kascit
Copy link
Copy Markdown
Owner

@kascit kascit commented May 11, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 11, 2026 14:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.html to extend base.html directly (rail layout parity) and added robots meta.
  • 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 thread templates/macros/head.html Outdated
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 thread static/js/features/access-keys.js Outdated
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);
@kascit kascit force-pushed the fix/lqip-and-template branch from 279e00e to 42ea8a1 Compare May 11, 2026 14:23
@kascit
Copy link
Copy Markdown
Owner Author

kascit commented May 11, 2026

@copilot apply changes based on the comments in this thread

@kascit
Copy link
Copy Markdown
Owner Author

kascit commented May 11, 2026

@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
@kascit kascit force-pushed the fix/lqip-and-template branch from b4628a7 to 74eada9 Compare May 11, 2026 14:36
@kascit kascit force-pushed the fix/lqip-and-template branch from 74eada9 to 8385a3f Compare May 11, 2026 14:41
@kascit kascit merged commit db6a66b into main May 11, 2026
17 checks passed
@kascit kascit deleted the fix/lqip-and-template branch May 12, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants