惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
有赞技术团队
有赞技术团队
L
LangChain Blog
C
Check Point Blog
博客园 - 【当耐特】
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
美团技术团队
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
S
SegmentFault 最新的问题
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗
腾讯CDC
B
Blog
G
Google Developers Blog
The Cloudflare Blog
P
Proofpoint News Feed

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I wrote a 403-check quality audit for a static site in ~1...
Patryk · 2026-06-12 · via DEV Community

Patryk

Static sites rot quietly. You add a page, forget a meta description, break the nav on one file, your JSON-LD stops parsing — and nothing tells you. Lighthouse is great but heavy, needs Chrome, and won't check your site's specific contracts (like "every tool page must link the privacy policy").

So I wrote a single-file audit script: 403 deterministic checks, ~130 lines, zero dependencies, runs in 3 seconds offline. Here's the approach.

The idea: checks as regex + tiny helpers

No headless browser, no HTML parser. For a static site you control, tolerant regex over the raw HTML covers 95% of what matters:

function check(file, name, ok) {
  total++;
  if (ok) passed++;
  else fails.push(`${file}: ${name}`);
}

const title = get(/<title>([^<]*)<\/title>/i, raw);
check(f, 'title 15-65 chars', !!title && title.trim().length >= 15 && title.trim().length <= 65);
check(f, 'canonical', /<link\s+rel="canonical"/i.test(raw));

// a11y: every input needs a label
const inputIds = [...raw.matchAll(/<(?:input|select)[^>]*\bid="([^"]+)"/gi)].map(m => m[1]);
const labelFors = new Set([...raw.matchAll(/<label[^>]*\bfor="([^"]+)"/gi)].map(m => m[1]));
check(f, 'every input has a label', inputIds.every(id => labelFors.has(id)));

Checks that caught real bugs

JSON-LD must parse. I once pasted a schema block after </head>. Valid-looking page, dead structured data:

const ld = [...raw.matchAll(/<script type="application\/ld\+json">([\s\S]*?)<\/script>/gi)];
check(f, 'JSON-LD parses', ld.length > 0 && ld.every(m => { try { JSON.parse(m[1]); return true; } catch { return false; } }));

WCAG contrast from your own palette. Parse :root hex variables, compute relative luminance, assert 4.5:1.

Link-grid consistency. Every page must share the identical nav set, and the homepage must link every tool page. I was maintaining this by hand and missed one — now it's a check.

Thin-content guard. Word-count per page; under 300 words a tool page fails. Ad networks reject thin pages, and so do readers.

The rule that made it work

Every real bug becomes a permanent check, same day. Misplaced schema → structure check. Hand-checked navigation → link-grid check. Slow bloat → 15 KB/page byte budget. The audit grew from 114 to 403 checks while the site stayed at 100%.

Result

Questions about specific checks welcome — happy to paste more in the comments.