Site: move to dz-delivery.younes-sarni.com (Cloudflare Pages)

Merged
DE
17d ago
+267-130

Part of #7 (domain and hosting section, plus quick fixes).

Changes

  • scripts/build-site.sh: builds _site/ with only the public site (home page, carrier folders, assets/, _headers). It also generates robots.txt and sitemap.xml, with lastmod taken from each page's last commit. The static sitemap.xml is removed.
  • _headers: X-Robots-Tag: noindex on *.pages.dev (production alias and previews), so only the custom domain gets indexed.
  • URLs: canonical, og:url, og:image, JSON-LD, sitemap, READMEs and homepage in package.json and composer.json now point to https://dz-delivery.younes-sarni.com/.
  • Home page <title> shortened to about 55 characters.
  • CI: new site job that builds the site and fails if developing-off.github.io is still in the output.

Before merging

  1. Cloudflare Pages: connect the repo, branch main, build command sh scripts/build-site.sh, output directory _site.
  2. Add dz-delivery.younes-sarni.com as a custom domain on the Pages project.
  3. Check that https://dz-delivery.younes-sarni.com/ loads (a preview of this PR works too).

Do not merge before the domain is live, or the canonicals will point to a page that does not exist.

After merging

  • Search Console: add the new property and submit https://dz-delivery.younes-sarni.com/sitemap.xml.
  • gh repo edit --homepage https://dz-delivery.younes-sarni.com/
  • GitHub Pages: leave it on for now (its canonicals already point to the new domain), and turn it off once Google has indexed the new URLs.
  • homepage on npm and Packagist updates with the next release.

šŸ¤– Generated with Claude Code


Summary by cubic

Moves the public site from GitHub Pages to Cloudflare Pages on the custom domain dz-delivery.younes-sarni.com, and re-points every canonical, Open Graph, JSON-LD, README and package-homepage URL at the new domain. This covers the domain-and-hosting part of #7.

Only the custom domain gets indexed: a _headers rule returns X-Robots-Tag: noindex on all *.pages.dev deployments and previews. scripts/build-site.sh assembles _site/ and generates robots.txt and sitemap.xml with lastmod dates taken from git history; the static sitemap.xml is removed. A new 404.html makes unknown URLs return 404 instead of the home page, and SITE_URL is validated as an origin at build time. Finally, the home page <title> is shortened, and CI now builds the site and fails if the old GitHub Pages URL still appears in the output.

Rollout

  • Set up the Cloudflare Pages project on branch main with build command sh scripts/build-site.sh and output directory _site, then add the custom domain before merging — merging early makes the canonicals point at a page that does not exist.
  • After the domain is live, submit https://dz-delivery.younes-sarni.com/sitemap.xml to Search Console and update the repository homepage.