BTrem

articles tagged “11ty”

“extensionless” urls with 11ty

Lots of web software is configured to create and serve web files/pages with an .html extension/suffix. That includes 11ty, which by default creates an index.html for each content template. It includes Browsersync — the hot-reload server invoked when you run npx @11ty/eleventy --serve — which determines the Content-Type response header based on the output file's extension. And it includes Apache HTTP server, which, like Browsersync, uses the extension to map a file to a Content-Type header.

And yet, even if your software defaults to .html, it is not mandatory for the web. There is no requirement that certain characters be attached to your web page urls. In this article, I'll explain how to make clean urls with Apache, Browsersync, and 11ty.

microblog with eleventy

I use 11ty to publish articles like this one, but I also want to be able publish status updates, sort of like my own Twitter feed. Like a Twitter feed, I want each update to include a date and time when I wrote it. Unlike a twitter feed, I don't want each post to have a permanent url. Instead, I want to show the most recent updates on my home page, and I want to bump off the oldest status update every time I add a new one. This article explains how I did it.