diff --git a/agents/console/server.mjs b/agents/console/server.mjs index f65a9da..8557758 100644 --- a/agents/console/server.mjs +++ b/agents/console/server.mjs @@ -639,8 +639,12 @@ const qaAbs = (href, pagePath) => { try { return new URL(href, QA_BASE + pagePat const qaGrabAll = (re, html) => [...String(html).matchAll(re)].map((m) => m[1]); const qaFirst = (re, html) => { const m = String(html).match(re); return m ? m[1].trim() : ""; }; function qaImgsNoAlt(html) { + // An image "has alt" if it carries an alt attribute at all — including an + // empty one (alt="" or a bare `alt`), which is the valid, deliberate signal + // for a decorative image. Only a total absence of alt is a finding. + const hasAlt = (tag) => /\salt(\s*=|[\s>\/])/i.test(tag); return [...String(html).matchAll(/]*>/gi)].map((m) => m[0]) - .filter((tag) => !/\balt\s*=/i.test(tag)) + .filter((tag) => !hasAlt(tag)) .map((tag) => (tag.match(/\bsrc=["']([^"']+)["']/i) || [])[1]) .filter(Boolean); } diff --git a/app/src/pages/sitemap.xml.js b/app/src/pages/sitemap.xml.js index 86e2b9a..ae96c20 100644 --- a/app/src/pages/sitemap.xml.js +++ b/app/src/pages/sitemap.xml.js @@ -1,14 +1,27 @@ import { SITE, authors, categories, sortedPosts, tags } from "../lib/blog-data.js"; +import { getProjects } from "../lib/projects.js"; const BASE_URL = SITE.url || ""; export async function GET() { const posts = await sortedPosts(); + const projects = await getProjects(); const entries = [ { path: "/", changefreq: "weekly", priority: "1.0" }, - { path: "/blog", changefreq: "daily", priority: "0.9" }, { path: "/about", changefreq: "monthly", priority: "0.6" }, + { path: "/services", changefreq: "monthly", priority: "0.7" }, + { path: "/services/website-design", changefreq: "monthly", priority: "0.6" }, + { path: "/projects", changefreq: "weekly", priority: "0.8" }, + { path: "/resume", changefreq: "monthly", priority: "0.6" }, { path: "/contact", changefreq: "monthly", priority: "0.5" }, + { path: "/faq", changefreq: "monthly", priority: "0.4" }, + { path: "/changelog", changefreq: "weekly", priority: "0.3" }, + { path: "/blog", changefreq: "daily", priority: "0.9" }, + ...projects.map((project) => ({ + path: `/projects/${project.slug}`, + changefreq: "monthly", + priority: "0.7", + })), ...posts.map((post) => ({ path: `/blog/${post.slug}`, lastmod: post.updated || post.date,