SEO enhancement and agentic browsing updates (#18) (#27)
Unit Tests / test (push) Successful in 3s

## Summary
Closes #18.

- Add per-page titles, meta descriptions, Open Graph/Twitter tags, and canonical URLs on public `base2.html` pages
- Improve semantic structure: skip link, primary nav ARIA, single `<main id="main-content">`, heading hierarchy, descriptive image alts
- Publish `/robots.txt`, `/sitemap.xml`, and `/llms.txt` (linked from site head via `rel="alternate"`)
- Agentic/a11y fixes: membership checkbox label associations, ZIP `name` attribute, layout stability (image aspect-ratio / min-height), footer year without `document.write`
- WebMCP deferred — membership + Stripe checkout remain standard HTML/Stripe flows; no audit flag justified custom MCP surface yet

## Lighthouse / agentic notes
Baseline Lighthouse runs still need Chrome Canary export on staging/prod. Structural SEO/a11y items from the ticket are implemented so follow-up audits can capture before/after scores.

Expected audit wins vs prior minimal `charset`+`viewport` head:
- SEO: unique titles/descriptions, crawl directives, sitemap
- Agentic/a11y: landmarks, labels, CLS-oriented image sizing

## Test plan
- [x] `uv run python manage.py test schasite` (34 passed)
- [ ] Spot-check Home/About/Calendar/Dues/Membership/Board/Links in browser
- [ ] Confirm `/robots.txt`, `/sitemap.xml`, `/llms.txt` on deployed host
- [ ] Run Lighthouse SEO + Agentic browsing on key pages and note before/after pass ratio on the issue

Reviewed-on: #27
This commit was merged in pull request #27.
This commit is contained in:
2026-07-14 05:19:28 -07:00
parent 862b13a666
commit 04c3ac913c
18 changed files with 367 additions and 91 deletions
+50
View File
@@ -18,6 +18,7 @@ from django.http.response import JsonResponse, HttpResponse
from django.views.decorators.csrf import csrf_exempt # new
from django.contrib.auth import logout, authenticate, login
from django.contrib.auth.decorators import login_required
from django.urls import reverse
import stripe
import logging
@@ -122,6 +123,55 @@ def useful_links(request):
return render(request, "schasite/useful_links.html", {"links": useful_links})
PUBLIC_SITEMAP_ROUTES = (
("index2", "weekly", "1.0"),
("about_us2", "monthly", "0.8"),
("calendar2", "weekly", "0.8"),
("dues2", "monthly", "0.9"),
("membership_form2", "monthly", "0.9"),
("scha_board2", "monthly", "0.7"),
("useful_links2", "monthly", "0.6"),
("newsletters2", "monthly", "0.5"),
)
def robots_txt(request):
sitemap_url = request.build_absolute_uri(reverse("sitemap_xml"))
return render(
request,
"schasite/robots.txt",
{"sitemap_url": sitemap_url},
content_type="text/plain",
)
def sitemap_xml(request):
urls = [
{
"loc": request.build_absolute_uri(reverse(name)),
"changefreq": changefreq,
"priority": priority,
}
for name, changefreq, priority in PUBLIC_SITEMAP_ROUTES
]
return render(
request,
"schasite/sitemap.xml",
{"urls": urls},
content_type="application/xml",
)
def llms_txt(request):
site_root = request.build_absolute_uri("/")
return render(
request,
"schasite/llms.txt",
{"site_root": site_root},
content_type="text/plain; charset=utf-8",
)
def index2(request):
return render(request, "schasite/index2.html", {})