From 264ca6383395306de38014b7ab2d3494050144ec Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Sun, 2 Aug 2026 17:05:10 -0500 Subject: [PATCH 01/16] docs: design SEO and performance improvements --- .../2026-08-02-seo-performance-design.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 docs/plans/2026-08-02-seo-performance-design.md diff --git a/docs/plans/2026-08-02-seo-performance-design.md b/docs/plans/2026-08-02-seo-performance-design.md new file mode 100644 index 0000000..1d70076 --- /dev/null +++ b/docs/plans/2026-08-02-seo-performance-design.md @@ -0,0 +1,72 @@ +# SEO and performance improvement design + +Date: 2026-08-02 + +## Goal + +Make the public site easier for search engines to understand and faster on a cold mobile load. Preserve the current visual design, static Astro architecture, and two-forge release flow. + +## Baseline + +Lighthouse 13 measured the deployed home page at 96 performance, 96 accessibility, 100 best practices, and 100 SEO on mobile. The desktop scores were 95, 96, 100, and 100. Mobile FCP and LCP were 2.3 seconds, TBT was 0 milliseconds, and CLS was 0.001. + +The audit found five material gaps: + +- Google Fonts blocks rendering and accounts for about 990 milliseconds of estimated savings. +- Hashed CSS and SVG assets have no explicit browser cache lifetime. +- HTTP serves a second working copy instead of redirecting to HTTPS. +- Pages lack product and article structured data. +- Two text treatments fail WCAG color contrast checks. + +The sitemap, canonical URLs, robots file, HTTPS pages, and real 404 status already work. + +## Design + +### Metadata and structured data + +Extend `Base.astro` with explicit page type, robots, publication metadata, and JSON-LD inputs. The home page will describe Green Tea as a software application and website. Blog posts will emit `BlogPosting` data, `og:type=article`, publication and modification dates, author, and tags. The 404 page will emit `noindex, follow`. + +Keep canonical URLs derived from `Astro.site`. Serialize structured data from trusted build-time objects and render it as an `application/ld+json` script. + +### Font delivery and accessibility + +Remove the Google Fonts stylesheet from the page and unused Starlight brand imports from the marketing site's global CSS. Host only the WOFF2 files required for Zen Maru Gothic weights 500 and 700 under `public/fonts`, declare them with `font-display: swap`, and preload only the heading face needed above the fold. + +Adjust the muted runtime caveat and syntax-comment colors until Lighthouse reports sufficient contrast. Do not change layout, spacing, copy, or component structure. + +### Apache behavior + +Add `public/.htaccess` so Astro copies it to `dist/.htaccess`. It will: + +- redirect HTTP requests to the same HTTPS URL; +- assign a long immutable cache lifetime to hashed `/_astro/` assets; +- assign shorter cache lifetimes to fonts and static images; +- enable compression when the host provides `mod_deflate` or `mod_brotli`; +- avoid changing routes or the existing 404 behavior. + +Every directive that depends on an optional Apache module will use an `IfModule` guard. The release must remain compatible with the current cPanel Apache host. + +### Release boundary + +GitHub remains the only forge that packages a production artifact. `.github/workflows/release.yml` already restricts its package job to `github.com` and creates `green-tea-site-.tar.gz` with `tar -C dist .`, which includes dotfiles. + +Add a release validation step after the build that fails unless `dist/.htaccess` exists. Gitea will continue to run the shared build gate and promotion workflow, but it will not package or publish a release artifact. + +## Verification + +Run a clean production build and verify: + +- `dist/.htaccess` exists and appears in a locally created tar listing; +- every indexable page has one canonical URL, description, and valid JSON-LD; +- the 404 page has `noindex, follow`; +- the sitemap lists only indexable public pages; +- no generated page requests Google Fonts; +- internal production links return expected statuses; +- Lighthouse mobile and desktop improve or hold their baseline scores; +- Lighthouse reports no automated SEO or contrast failures. + +The final report will separate local build results from behavior that requires the new artifact to be deployed on Apache. + +## Non-goals + +This change will not redesign the site, add analytics, create keyword-stuffed copy, submit the site to Search Console, modify the documentation build under `/docs`, or create release archives in Gitea. -- 2.54.1 From 78fcec0283ea1c1c3408da43d0f9ef1ecafa58cc Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Sun, 2 Aug 2026 17:08:23 -0500 Subject: [PATCH 02/16] 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 && ( +