Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions wp-static-clone/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ mkdir -p output/wp-content/plugins/wordpress-seo/css
curl -s -A "Mozilla/5.0" \
"$ROOT/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl" \
-o output/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl

# Repoint the sitemaps' <?xml-stylesheet?> at the LOCAL copy. Yoast emits it as a
# protocol-relative absolute URL (`href="//<domain>/wp-content/.../main-sitemap.xsl"`).
# Left alone, the browser fetches the XSL cross-origin from the live site, the XSLT
# transform is blocked, and the sitemap renders as a BLANK page (raw XML is fine in
# view-source — only the styled render breaks). rewrite-paths.py won't fix this: it
# only touches *.html, and its abs-URL rule matches `https?://`, not `//`.
SRC=${ROOT#http*://} # bare domain, e.g. example.com
for f in output/*.xml; do
perl -0pi -e "s{href=\"(?:https?:)?//\Q$SRC\E(/wp-content/plugins/wordpress-seo/css/main-sitemap\.xsl)\"}{href=\"\$1\"}g" "$f"
done
```

## Phase 2 — One-shot wget
Expand Down
2 changes: 1 addition & 1 deletion wp-static-clone/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ These are the things that bit us. Don't repeat them.

4. **WordPress Offload Media plugins** route `/wp-content/uploads/` to R2 / S3 buckets. wget may successfully fetch an image even when later direct access 404s (intermittent or partial bucket sync). Trust your local copy — that's why we scrape and self-host.

5. **Sitemaps and the Yoast XSL aren't linked from HTML.** wget `-p` won't find them. Fetch explicitly in Phase 1.
5. **Sitemaps and the Yoast XSL aren't linked from HTML.** wget `-p` won't find them. Fetch explicitly in Phase 1. And after fetching, **repoint each sitemap's `<?xml-stylesheet?>` at the local copy** — Yoast emits it as a protocol-relative absolute URL (`href="//<domain>/wp-content/.../main-sitemap.xsl"`). Left alone, the browser fetches it cross-origin from the live site, the XSLT transform is blocked, and the sitemap renders **blank** (view-source shows the XML fine — only the styled render breaks). `rewrite-paths.py` won't catch it: it processes `*.html` only, and its abs-URL rule matches `https?://`, not `//`. Recipe in Phase 1 of `AGENTS.md`.

6. **Filenames with `?ver=...` query strings.** wget keeps these as literal filenames; HTML uses `%3F` encoding. Standard servers (Pages, Netlify, Vercel, `python -m http.server`) URL-decode and serve correctly. Don't try to "clean these up" unless something actually breaks.

Expand Down