| :--- | :--- | | Writing Exp | Web browser editor | VS Code / Vim (Local environment) | | Offline | Impossible (Net required) | Possible (Can write on a plane) | | Images | GUI Drag & Drop (Easy) | Hand-writing file paths (Pain) | | Version Control | Dependent on service history | Full power of Git available | | Vendor Lock-in | Yes (Risk of shutdown/price hikes) | None (Text files are forever) | | Op Cost | Depends on plan (Free tier limits) | Free |
In short, I took “Freedom and Control (Git)” over “Convenience (CMS).” I never want to do the work of “The service ended, so export the articles and…” ever again. If I have them as Markdown files at hand, I figure if GitHub dies, I can just go to GitLab.
How to Deploy to Cloudflare Pages
Cloudflare Pages supports Git Submodules, so basically, if you don’t mess up the settings, it works.
1. .gitmodules Settings
Specify the content repository path in the .gitmodules file in the System Repository.
Note that if it’s a public repository, write the HTTPS URL. If you use SSH ([email protected]:...), it will cause permission errors in Cloudflare’s build environment.
[submodule "src/contents"] path = src/contents url = https://github.com/your-name/your-content-repo.gitRelative paths also work.
[submodule "src/contents"] path = src/contents url = ../your-content-repo.gitEven if the content repository is Private, it works if authorized on the Cloudflare side, so there’s no need to make it Public (though there’s probably nothing problematic in public blog posts…).
2. Build Command
Cloudflare Pages automatically runs git submodule update --init --recursive before the build (Godsend).
So, just like normal Astro, pointing the build command to npm run build and the output directory to dist is OK.
Summary
- Pros: Isolate content from technical debt. Clean DDD-like structure. Future migration is easy.
- Cons: Daily operations (Git ops) steps increase.
Honestly, if asked “Is this necessary for a personal blog?”, I would answer “No.” However, as engineers, there are times we want to eat our meals on a “romantic architecture.” If you want to sublimate “just a blog” into a “designed content delivery system,” please step onto this thorny path.



