Site-wide quality pass: performance, SEO, accessibility, and architecture - #23
Merged
Conversation
Performance - Replace React SearchModal/AnalyticsConsent islands with vanilla Astro components — drops react-dom (~56 KB gzip) from every static page - inlineStylesheets: 'auto' — shared CSS ships once as a cacheable file instead of being inlined into all 100+ pages - Load KaTeX CSS only on posts that contain math - Preload the three above-the-fold woff2 fonts - Add _headers: immutable caching for hashed assets, cache policy for /og/* and /_pagefind/*, baseline security headers SEO - rss.xml: drop trailing slash from item links (match canonicals) - Remove duplicate Organization/WebSite JSON-LD on the homepage; enrich the site-wide copy with discord sameAs + publisher - Add twitter:image:alt; tighten homepage title under 60 chars - Cover images get real alt text + dimensions (CLS fix) - Remove non-standard Host: line from robots.txt Accessibility - Lightbox: keyboard-openable images, dialog semantics, focus restore - Theme toggle: aria-pressed state + prefers-color-scheme fallback - Nav links: aria-current; author page heading hierarchy fixed Architecture - New PostRow.astro replaces blog-row markup duplicated across 5 pages - New lib/posts.ts (resolvePostAuthors, authorNames) replaces the author-resolution boilerplate repeated in 7 files - lib/prefs.ts now actually used by Nav + homepage accent scripts - lib/pagefind.ts shared loader (was duplicated in two components) - WritePortal: dialogs + doc utils extracted, casts centralized - create-pr.ts: fileExistsOnMain() helper replaces duplicated checks - formatDate/formatMonth accept Date directly - Comment cleanup: remove narration/decorative comments, keep WHY notes - [hidden] display reset so attribute-hidden UI always stays hidden
Deploying mlsystems with
|
| Latest commit: |
47c794b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5b8f95b1.mlsystems.pages.dev |
| Branch Preview URL: | https://feature-site-quality.mlsystems.pages.dev |
|
Tip |
One NewsletterCta component, two placements: compact block above the footer bottom bar (site-wide) and a card at the end of each article. Renders nothing until SITE.newsletterUrl is set (e.g. a Google Form), same graceful pattern as giscus/likes.
Three minimal cards per row (scroll-snap for up to six), title + author/date only — read time and redundant per-card topic chips dropped.
Copy icon next to "Cite as" copies the citation plus the page URL; icon flips to a check while copied.
- Newsletter: centered capsule strip above the footer opens an inline email dialog; submits to a Google Form in the background (no redirect), graceful error when unconfigured or offline; mobile stacks centered - Citation line on posts gets a copy button (citation + page URL) - Homepage: topics count removed from hero stats - ToolGlyph: VRAM-stack icon for gpu-mem-calc (was blank); dead cost-calc case removed - External playground tools fact-checked against the live web; four descriptions corrected
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.
What this does
One PR covering the full website review findings — performance, SEO, accessibility, and code architecture. No URLs, content, or visual design changed; search engines see the same pages, only lighter and with cleaner signals.
Performance
/aboutwent from ~80 KB to 26 KB.inlineStylesheets: 'auto'— the design-system CSS ships once as a cacheable/_astro/*.cssinstead of being duplicated into all 100+ HTML files._headers— immutable caching for hashed assets, cache policy for/og/*+/_pagefind/*, baseline security headers (nosniff, referrer-policy, frame, permissions).SEO
sameAs+publisher.twitter:image:altadded; homepage<title>tightened under 60 chars.Host:removed from robots.txt.Accessibility
role=dialogwith focus restore on close.aria-pressedand falls back toprefers-color-schemewhen no saved preference.aria-current; author-page heading hierarchy fixed (h1 → h2).Architecture / clean code
PostRow.astro— one component replaces the post-row markup previously copy-pasted across 5 pages.lib/posts.ts—resolvePostAuthors()+authorNames()replace the author-resolution boilerplate repeated in 7 files (server-only, kept out of client-bundleddata.ts).lib/pagefind.ts— shared loader (was duplicated in two components);lib/prefs.tsis now genuinely used by Nav + homepage scripts instead of being dead code triplicated inline.write/dialogs/, table/image helpers towrite/editor/docUtils.ts, BlockNote cast centralized in one accessor.create-pr.ts: duplicated raw-fetch existence checks replaced by onefileExistsOnMain()helper.formatDate/formatMonthacceptDatedirectly —.toISOString()churn removed at ~11 call sites.[hidden] { display: none !important }reset so attribute-hidden UI can't be resurrected by component display rules.Verified
npm run verifygreen: astro check (0 errors), eslint (--max-warnings 0), prettier, 56/56 tests.dist/: no react on static pages, stylesheet emitted as cacheable link, zero KaTeX bytes on non-math posts, search-modal markup present withhiddenenforced.Worth testing on the preview
// nav button), analytics consent banner, theme toggle, homepage accent cycling — these were rewritten from React to vanilla.