From 78fcec0283ea1c1c3408da43d0f9ef1ecafa58cc Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Sun, 2 Aug 2026 17:08:23 -0500 Subject: [PATCH] docs: plan SEO and performance implementation --- ...26-08-02-seo-performance-implementation.md | 366 ++++++++++++++++++ 1 file changed, 366 insertions(+) create mode 100644 docs/plans/2026-08-02-seo-performance-implementation.md diff --git a/docs/plans/2026-08-02-seo-performance-implementation.md b/docs/plans/2026-08-02-seo-performance-implementation.md new file mode 100644 index 0000000..a7a8646 --- /dev/null +++ b/docs/plans/2026-08-02-seo-performance-implementation.md @@ -0,0 +1,366 @@ +# SEO and Performance Improvements Implementation Plan + +> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. + +**Goal:** Improve search-engine metadata, remove the render-blocking font dependency, fix automated contrast failures, and ship Apache redirects and caching inside the GitHub release artifact. + +**Architecture:** Keep Astro's static output and extend the existing base layout with typed metadata and build-time JSON-LD. Vendor the two Latin WOFF2 font files, copy Apache configuration from `public/`, and verify generated HTML with a dependency-free Node script. Preserve the shared Gitea/GitHub build gate while keeping production packaging exclusive to GitHub. + +**Tech Stack:** Astro 7, TypeScript, plain CSS, Node.js assertions, Apache `.htaccess`, GitHub Actions, Lighthouse 13. + +--- + +### Task 1: Add a failing generated-site verifier + +**Files:** +- Create: `scripts/verify-build.mjs` +- Modify: `package.json` + +**Step 1: Create the verifier** + +Write a Node script that reads `dist/index.html`, `dist/404.html`, the blog index, and every generated blog post. Use `node:assert/strict` to require: + +- one canonical URL and one meta description per HTML page; +- parseable JSON-LD on the home page and each blog post; +- `SoftwareApplication` in the home JSON-LD graph; +- `BlogPosting`, article Open Graph metadata, dates, and author on each post; +- `noindex, follow` on the 404 page; +- no reference to `fonts.googleapis.com` or `fonts.gstatic.com`; +- a generated `dist/.htaccess` file. + +The script should end with `Verified generated SEO and deploy metadata.` and exit nonzero on the first failed assertion. + +**Step 2: Add build-check scripts** + +Add these entries to `package.json`: + +```json +"check": "npm run build && npm run verify:build", +"verify:build": "node scripts/verify-build.mjs" +``` + +**Step 3: Run the verifier against the current build** + +Run: `npm run build && npm run verify:build` + +Expected: FAIL because the current output has no JSON-LD and no `dist/.htaccess`. + +**Step 4: Commit the failing verifier** + +```bash +git add package.json scripts/verify-build.mjs +git commit -m "test: verify generated SEO metadata" +``` + +### Task 2: Add typed global and home-page SEO metadata + +**Files:** +- Modify: `src/layouts/Base.astro` +- Modify: `src/pages/index.astro` + +**Step 1: Extend the base layout contract** + +Add these optional props: + +```ts +type OpenGraphType = 'website' | 'article'; +type StructuredData = Record; + +interface Props { + title?: string; + description?: string; + image?: string; + ogType?: OpenGraphType; + robots?: string; + publishedTime?: Date; + updatedTime?: Date; + author?: string; + tags?: string[]; + structuredData?: StructuredData; +} +``` + +Default `ogType` to `website` and `robots` to `index, follow`. Convert the canonical and image URLs to strings before using them in metadata. + +Emit: + +```astro + + +{ + ogType === 'article' && ( + <> + {publishedTime && } + {updatedTime && } + {author && } + {tags?.map((tag) => )} + + ) +} +{structuredData && ( +