Tag: dynamic content

Articles and experiments related to dynamic content.

Simulating Apache mod_include for Vercel

For my Hugo static site hosted on Vercel, I wanted a simple way to include server-side logic, like a copyright notice, without setting up a full backend. I created a function that mimics Apache's mod_include to inject dynamic content. It rewrites HTML requests through a handler that parses files for <!--#include ... --> directives. The file command injects file content, while the virtual command fetches content from the /api directory (like a modern /cgi-bin/). Caching is crucial for performance. Check out the demo and code. A more robust solution like Cloudflare Workers' HTMLRewriter would be ideal, but this works for simple use cases.

Read article

Potential Upgrades to my Blog

I'm planning some exciting upgrades to my blog! Soon, each post will feature a dynamically generated section at the end, pulling in related content like searches, blogs, images, and Wikipedia articles, all based on the post's context. No caching for now, but I'm considering it for the future. You'll also be able to subscribe to an OPML file containing an outline of all this related information for each post.

Read article

Stay in the loop.

I'm trialing a newsletter. Join for monthly insights into web dev, Chrome, and the open web.

alternate_email

Get in touch

Open to chat about Chrome or Web development.

Book a consultation