Build a Website!
Published 2026-09-20
The modern web is rotting. Advertising clamours for your attention, tracking cookies strong-arm your personal data, you have an account for every social media "platform", and Clippy has returned as an AI chatbot from hell making you jump through hoops to send a message to real human in customer support.
It's time to make surfing the web fun again. And you don't need "JavaScript", a "Web Framework" or "PHP" to do it, whatever those are ;)
Eager to start building your own simple website? Feel free to jump ahead!
Old-web Blogging
The website you're reading from right now doesn't use any JavaScript. There are no ads and no cookies. As a read-only site, almost everything I want it to do is possible with pure HTML and CSS files. That's nice and simple, I can just slap some text in a file and call it day. However, almost everything is not everything. For instance, I want a blog for my site, with the main blog page featuring previews of blog posts. The only trouble is, if I were to use just HTML & CSS, I would have to copy a bunch of text into the /blog page for previews of the posts. And were I to change the content of one of those posts, I'd have to manually copy those changes again.
Simple websites on the modern web usually solve this with a static site generator that generates HTML from template files. This approach works really well, but requires an additional piece of software to work, often also requiring learning a bespoke mark-up language for the templates. I considered this - I have used one in the past - but it adds a lot of extra baggage when I really just want to practice my HTML and CSS skills rather than dealing with an extra system on top.
In the past, before static site generators were commonplace, people instead turned to the scripting language PHP. PHP is used in a lot of modern websites too as it's relatively simple and is built for easy integration with HTML, and a lot of hosting providers include it. Technically this makes a website dynamic rather than static, but you can craft a relatively simple site with just a little bit of PHP to include disparate HTML files. In my case this would let me craft a single HTML file as a blog post, then using PHP I could include it (potentially trimmed down) as a preview on the main blog page. Unfortunately this still falls short of our goal of plain HTML and CSS editing as it requires additional software to be available & kept up to date - becoming a potential security risk.
While PHP runs on the server backend, there is terrible approach we could adopt these days: Using JavaScript to request the content of each blog post from the browser, and trim it down for the main blog page previews. Needless to say this would mean adding a bunch of loading spinners to our page as we try and get every blog post preview. It would save us (the website maker) time but would make the site slow to use for anyone in a browser and inaccessible for those who prefer not to use a JavaScript-enabled browser.
There HAS to be a simpler way. A way to embed content from multiple HTML files into one, but only a shortened version of just the main content those files, for our blog post previews... to show a list of links to all blog posts automatically... to show when the blog post was made and last edited...
Well, it's your lucky day. Because all along, your HTTP server had everything we wanted!
The Magic of Server-Side Includes
NGINX and Apache, two of the most common HTTP servers that websites run on, have a little-used feature known as SSI (Server-Side Includes). These are special HTML comments that are pre-processed by NGINX or Apache before serving a request for the file, providing a range of simple but powerful functions such as including content from other HTML files in the response. Unlike JavaScript this all happens server-side (hence the name), and doesn't require anything extra like PHP. Your vanilla NGINX or Apache install happily processes these includes on every request, and all we need to do is enable the functionality in the server configuration file(s).
Build a Blog With Server-Side Includes
For this recipe you'll need to gather the following ingredients. Don't be afraid to find some help on the web, via a search engine for instance (just be wary your data isn't stolen).
- A computer that you are happy to leave running 24/7, operating Linux. I use a cheap Raspberry Pi with Raspberry Pi OS. If you don't have a suitable computer this is a one-time purchase.
- A domain name, registered by one of the services supported by ddclient. This costs money but cheap domains can go for less than £10 a year.
- A HTTP server such as NGINX [install instructions] or Apache [install instructions] that supports Server-Side Includes out of the box.