Introduction

I was trying to migrate my blog site from Github pages to Cloudflare pages, but encountered an issue with incorrect URLs for some requested resources due to the baseURL parameter in configuration file. The baseURL represents absolute URLs. The path is appended to the end of the baseURL. When using custom domains in Cloudflare pages, the spliced URL is always xxx.pages.dev/<resource_path> instead of <your_domain>/<resource_path>

Solution

The solution comes from Nathan. I replace all of these three variables in the project, and then the issue was solved.

  • absURL ->relURL
  • absLangURL ->relLangURL
  • .Permalink ->.RelPermalink

Reference