How I update this site
I started making websites in the early 2000's, cutting up images and cramming them into tables for that authentic geocities look. And then... I pretty much didn't touch any webdev for the next two decades. You could say I've missed out on a few new developments.
So to keep it simple, this site is all HTML and CSS, just like in the good old days. (And a tiny sprinkle of Javascript, to enable toggling dark mode.) What's new is that I'm using a static site generator to automate most of the work. There are a lot of these static site generators out there; I use Eleventy.
To illustrate why I would prefer this method over just editing the HTML files directly, let me show you my new workflow for updating this blog:
- I run
npx @11ty/eleventy --serve
in my terminal - I open a new tab in my browser and navigate to the local copy of this site
- I open my code editor (VIM)
- I create a new markdown file in the "blog" folder on my hard drive
- I type the word "post" and hit tab
- I fill out the title, description, tags and start writing
- I hit save
- I wait for Eleventy to do its thing (this takes about a second)
- I check in the browser whether everything looks okay, maybe make some changes as needed
- Once I'm happy, I upload the contents of the "site" folder to my remote host, only overwriting the files that are newer.
And that's it! It sure beats wrangling with HTML table cells.
Ultisnips #
Ultisnips is a plugin for VIM that lets you easily insert snippets of text or code. Here's the snippet I made that I use on step 5 above:
snippet post "new blog post"
---
title: ${1:title}
description: ${2:description}
date: `!p import datetime
snip.rv = datetime.datetime.now().strftime("%Y-%m-%d")`
tags:
- ${3:tag}
---
${4:blog text}
endsnippet
Note that you'll need to have Python 3 support enabled in VIM for it to automatically insert today's date.
- Previous: Hello World!