How I run my portfolio and blog on Cloudflare Workers for free
For a long time my web presence was split in two. My portfolio was a Django app on shared hosting, with its own admin panel, database and media folder. My blog was a Blogger theme sitting on www.dhimal.com.np. They looked nothing alike, I had to update them in two places, and my second domain, himald.com.np, didn't resolve at all.
This week I rebuilt the whole thing. It's now one site on two domains, served by a single Cloudflare Worker, on the free plan. I still write posts in Blogger, because its editor is genuinely convenient, but readers never see a Blogger theme. This post explains how it works and why I made each choice.
Why not just keep Django?
I like Django; most of my work is in it. But a portfolio is mostly static. It changes a few times a year. Running a Python process, a database and an admin panel for a page that rarely changes means more to patch, more to back up and more that can go down. A static page on a CDN loads faster and needs nothing from me once it's deployed.
The blog was the tricky part. A static site generator would mean writing Markdown and redeploying for every post. I wanted to be able to write from my phone and press publish, which Blogger already does well. So the question became: can I keep Blogger as the editor but render the posts inside my own site?
The architecture
There are only three pieces:
- Static assets. The home page, stylesheet, photo and these diagrams are plain files uploaded with the Worker.
- A Worker that runs first on every request. It handles redirects, decides what each URL means, and builds the blog pages from templates.
- Blogger's JSON feed. Every Blogger blog exposes its posts at
/feeds/<blog-id>/posts/default?alt=json. With the feed set to Full in Blogger's settings, it includes the complete HTML of every post.
One Worker, every URL
The Worker is about 270 lines of JavaScript with no dependencies. Fetching the posts looks like this:
const FEED = `https://www.blogger.com/feeds/${BLOG_ID}/posts/default?alt=json&max-results=150`;
async function getPosts() {
const res = await fetch(FEED, { cf: { cacheTtl: 300, cacheEverything: true } });
const data = await res.json();
return (data.feed.entry || []).map((e) => ({
title: e.title.$t,
path: new URL(e.link.find((l) => l.rel === "alternate").href).pathname,
published: e.published.$t,
html: e.content.$t,
}));
}
The cf.cacheTtl option tells Cloudflare to keep the feed response at the edge for five minutes. Readers never wait on Blogger, and a new post shows up on the site within about five minutes of publishing.
Keeping old links alive
Blogger post URLs look like /2026/11/my-post.html. I kept exactly that format. The Worker matches it with a regular expression, finds the post in the feed by its path, and renders it in my design. Blogger's custom domain still points at www.dhimal.com.np, and the Worker redirects www to the bare domain. So any link to the old blog still lands on the right post.
Blogger's static pages (/p/about.html, /p/contact.html) redirect with a 301 to the matching sections of the home page. Search engines see a permanent move instead of a dead link.
Taming Blogger's HTML
Blogger's editor sprinkles inline styles everywhere: font families, font sizes, colours, background colours, and empty lines made of stacked <br> tags. Dropped into a dark theme, that looks broken. A few CSS rules scoped to the article body neutralise it:
.prose * { font-family: inherit !important; background-color: transparent !important; }
.prose [style*="font-size"] { font-size: inherit !important; }
.prose [style*="color"] { color: inherit !important; }
.prose a { color: var(--accent) !important; }
.prose br + br { display: none; }
Now whatever I paste into Blogger comes out in the site's typography.
Two domains, one canonical URL
Both dhimal.com.np and himald.com.np are attached to the same Worker. They serve identical pages, and every page declares https://dhimal.com.np/… as its canonical URL. Search engines treat the second domain as an alias rather than duplicate content.
On the Cloudflare side, dhimal.com.np uses Worker routes because its DNS records already existed and were proxied. himald.com.np was a fresh zone, so it uses Worker custom domains, which create the DNS records and certificate automatically.
What it costs
Nothing. The Workers free plan allows 100,000 requests a day, and static assets are served from Cloudflare's network. Blogger is free. The only recurring cost is the domains, and .com.np domains are free for Nepali citizens.
Trade-offs I accepted
- Five-minute delay. A post can take up to five minutes to appear. For a personal blog that's fine.
- No comments on the site. I turned Blogger comments off. If you want to discuss a post, email me or find me on LinkedIn.
- Feed size. The Worker reads the latest 150 posts. When I get anywhere near that, I'll add paging.
- Blogger is a dependency. If the feed is unreachable, the blog shows a short "briefly unavailable" page while the rest of the site keeps working.
Takeaway
You don't have to choose between a nice editor and owning your design. Keep the tool you like for writing, treat it as a data source, and put a thin layer at the edge that turns that data into your own pages. For a personal site, a single Worker is enough.
If you're building something similar, or want help moving a site off shared hosting, get in touch.
Himal Dahal
CTO at Daleema Group. Backend developer in Kathmandu.