Hello, world
This is the first post on the new version of the blog. Posts are plain text files written in Djot, and a small Node script turns them into HTML.
Here is a short code sample, highlighted at build time:
function binarySearch(items, target) {
let lo = 0;
let hi = items.length - 1;
while (lo <= hi) {
const mid = (lo + hi) >> 1;
if (items[mid] === target) return mid;
if (items[mid] < target) lo = mid + 1;
else hi = mid - 1;
}
return -1;
}
To start a new post, run npm run new -- your-slug. It creates a dated file in content/posts.