ข้ามไปเนื้อหาหลัก

● กำลังพัฒนา

Astro SEO Audit

CLI script ตรวจ SEO ของ Astro static site — ตรวจ meta tags, canonical URL, Open Graph, structured data และ performance hints

· อ่านประมาณ 1 นาที

สารบัญ

ภาพรวม

เว็บ static site มีหน้าจำนวนมาก ตรวจ SEO ด้วยมือทีละหน้าทำได้ไม่ครบ โปรเจกต์นี้ crawl ไฟล์ HTML ที่ build แล้วและสร้าง audit report แบบ structured — ใช้ได้กับ Astro build output (dist/)

สิ่งที่ทำแล้ว

  • Meta tags audit — ตรวจ title (ความยาว 30-60 chars), description (50-160 chars), viewport
  • Open Graph audit — ตรวจ og:title, og:description, og:image ครบหรือไม่
  • Canonical URL — ตรวจว่ามี canonical link element ทุกหน้า
  • Heading structure — ตรวจ H1 (ต้องมีและมีแค่ 1), H2 ไม่ข้าม level
  • Alt text — ตรวจ img ทุกตัวว่ามี alt attribute
  • Structured data — ตรวจว่า JSON-LD valid และมี required fields
  • Score per page — คะแนน 0-100 พร้อม breakdown

กำลังทำ

  • Internal link checker — ตรวจ broken links ภายใน site
  • Image size hints — แจ้ง image ที่ใหญ่เกิน threshold
  • XML Sitemap validator — ตรวจ sitemap.xml ว่าครบถ้วน
  • CI mode — exit code 1 ถ้ามี critical issues เพื่อ block deploy

เทคโนโลยี

  • TypeScript + Node.js 22
  • cheerio สำหรับ parse HTML
  • fast-glob สำหรับ find HTML files
  • kleur สำหรับ color output
  • ajv สำหรับ validate JSON-LD schema