Repository navigation
fix: pin SEO URLs to code-echo.pages.dev on both hosts - #63
Merged
Merged
Conversation
Commit the Cloudflare Pages origin as site.url so GitHub Pages and Cloudflare production both emit absolute canonical/hreflang/og/JSON-LD and feed links. Add a Liquid sitemap and always-on robots Sitemap line so GH Pages (no custom plugins) no longer ships relative <loc> values. Co-authored-by: Aaron Xia <zhhuaxia@gmail.com>
Keep robots.txt and XML declarations free of leading blank lines, and avoid Jekyll looking up a nonexistent "nil" layout for feed/sitemap. Co-authored-by: Aaron Xia <zhhuaxia@gmail.com>
Deploying code-echo with
|
| Latest commit: |
2d31964
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c7089680.code-echo.pages.dev |
| Branch Preview URL: | https://cursor-canonical-domain-seo.code-echo.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GitHub Pages was shipping relative canonical/hreflang/feed links, relative sitemap
<loc>values (invalid), and arobots.txtwith no Sitemap line. Cloudflare production was already fine becauseSITE_URLis injected at build time. This makes both builds emit absolute URLs pointing at the canonical hosthttps://code-echo.pages.dev, so the GitHub Pages copy consolidates ranking signals to Cloudflare.What changed
url: https://code-echo.pages.devin_config.yml(local serve still overrides via_config_local.yml). Cloudflare preview should leave this as-is so preview hostnames are not indexed as a second origin; relative CSS/nav links keep previews browsable._includes/absolute-origin.htmlfallback: ifsite.urlis empty or isassertion.github.io, templates still emit the Cloudflare origin.sitemap.xml(Liquid) so GitHub Pages — which cannot run_plugins/— still writes absolute<loc>values, keepslastmodon posts, and omits empty paginator pages / 404 / the markdown test page.robots.txtalways includesSitemap: https://code-echo.pages.dev/sitemap.xmlon production builds.google_site_verification/bing_site_verificationin_config.yml(empty). Rendered asgoogle-site-verificationandmsvalidate.01only when set.hreflang="x-default"now always points at the ZH twin./404.htmland/markdownarenoindex+sitemap: false._posts/untouched.Verification (Jekyll 3.10 local builds)
Production (
jekyll build --config _config.yml) — same committedurlused by GitHub Pages and Cloudflare:https://code-echo.pages.dev/...locs, 0 relative, 57lastmods (all posts). Excluded/page4/,/markdown,/404.html. Kept/,/about,/categories/,/wiki/,/page2/,/page3/.<link rel="canonical" href="https://code-echo.pages.dev/2026/10/09/ai-twitter-hots" />plus matching hreflang / og:url / feed /.md/ JSON-LD.hreflang="x-default"points at the ZH URL./markdown,/page4/each haverobots=noindex.google_site_verification/bing_site_verificationrenderedgoogle-site-verificationandmsvalidate.01._config.yml(prod / GH / CF)https://code-echo.pages.dev/2026/10/09/ai-twitter-hotshttps://code-echo.pages.dev/sitemap.xml_config_local.ymlhttp://localhost:4000/2026/10/09/ai-twitter-hotshttp://localhost:4000/sitemap.xmlurl: ""fallbackhttps://code-echo.pages.dev/2026/10/09/ai-twitter-hotshttps://code-echo.pages.dev/sitemap.xmlAfter merge
_config.ymlwhen issued (google_site_verification,bing_site_verification).https://code-echo.pages.devas the property and submithttps://code-echo.pages.dev/sitemap.xml.site:will stay empty until the property is verified and crawled.urlwith the preview hostname, or preview pages will advertise a second origin.Noted, not changed
_plugins/, so plaintext.mdcopies are Cloudflare-only. After this change therel=alternatemarkdown links on the GitHub Pages HTML point at the Cloudflare URLs, which do exist.https_enforcedis currently off (http://assertion.github.io). Harmless once canonicals point at Cloudflare.