Deploy — GitHub + Cloudflare (সহজ পথ)¶
তোমার site তো MkDocs (Python) — এটা শুধু static HTML বানায় (mkdocs build → _site/ ফোল্ডার)। তাই কোনো custom Cloudflare Worker, backend, বা extra code লাগে না। যেকোনো static host-এ বসিয়ে দিলেই চলে। নিচে দুটো সহজ উপায়।
Repo = এই
data-structuresফোল্ডার (এর ভেতরেইmkdocs.yml,requirements.txt,.github/)।
Option A — Cloudflare Pages (GitHub থেকে auto-deploy) ✅ recommended¶
Cloudflare-এর নিজের MkDocs support আছে, তাই কোনো Worker লিখতে হয় না — Pages নিজেই mkdocs build চালায়।
ধাপ:
- GitHub-এ repo push করো (নিচের Local অংশ + git দেখো)।
- Cloudflare dashboard → Workers & Pages → Create → Pages → Connect to Git → তোমার repo select করো।
- Build settings দাও:
- Framework preset:
MkDocs(বাNone) - Build command:
pip install -r requirements.txt && mkdocs build - Build output directory:
_site - Root directory:
/(repo root; যদি Cloudflare-এ পুরো "Data Science Study" push করো তাহলেdata-structures) - Environment variables-এ যোগ করো:
PYTHON_VERSION=3.12(default 3.7 দিয়ে mkdocs-material চলবে না)। - Save and Deploy। ব্যস — প্রতিবার GitHub-এ push করলে Cloudflare নিজে থেকে rebuild + publish করবে। Link পাবে
https://<project>.pages.dev।
⚠️ আমাদের
mkdocs.yml-এsite_dir: _site(defaultsiteনয়), তাই output directory অবশ্যই_siteদিতে হবে। আরmkdocs-same-dirpluginrequirements.txt-এ আছে, তাই Cloudflare সেটা install করে নেবে।
Option B — GitHub Pages (আরও সহজ, already wired)¶
এই repo-তে .github/workflows/deploy-docs.yml আগে থেকেই আছে — GitHub Actions নিজে build + deploy করবে।
- repo push করো।
- GitHub → repo → Settings → Pages → Build and deployment → Source = "GitHub Actions"।
- ব্যস। push করলেই site live (
https://<username>.github.io/<repo>/)।
(Cloudflare Pages ব্যবহার করলে এই GitHub Action লাগবে না — যেকোনো একটা বেছে নাও।)
Local-এ চালানো + GitHub push¶
cd "D:\MyFiles\DS\Data Science Study\data-structures"
# একবার:
pip install -r requirements.txt
# পড়তে/preview:
mkdocs serve # → http://127.0.0.1:8000
# GitHub-এ তোলা:
git init
git add .
git commit -m "Bengali DSA notes + MkDocs site"
git branch -M main
git remote add origin https://github.com/<username>/<repo>.git
git push -u origin main
কেন "Worker" আলাদা করে দরকার নেই¶
Cloudflare Worker হলো code চালানোর জন্য (JS/TS request handler)। কিন্তু MkDocs site তো আগেই HTML/CSS/JS-এ compile হয়ে যায় — চালানোর মতো server-side কিছু নেই। তাই Pages (static host) দিয়েই সবচেয়ে সহজ, দ্রুত, আর free-তে হয়ে যায়। (পরে যদি code live "Run" করার playground চাও, তখন আলাদা করে Worker/Pages Functions যোগ করা যাবে।)
Sources: Cloudflare Pages — MkDocs guide · Cloudflare Pages build configuration