Caspar.Green Blog

Notes to myself.

Baby Steps

Posted on 10 Apr 2021 9:47 am

I have the bare bones of an app working now.

So far, it reads all the posts from a posts table from the database and shows everything. I also have some very basic things in place like reading a json configuration file and using a .env file to store the environment details, like database access stuff.

Getting all the things into the database, so far, is creating the table and inserting the data manually. Creating an administration page to take care of that is one of the first next things.

First, Think

Posted on 21 Mar 2021 10:00 am

Before writing code you have to think things through.

After getting the new server configured and the site back online with the Rebooting post, I set up a new local environment for development. I’m running PHP 8 on an Apache server for the application, Nginx for serving static assets, MariahDB, Redis and a Varnish cache. (But, so far, this page is still just straight-up HTML.)

I created a new repository for the blog, and I’m calling it simple.

Beyond that, now it’s time to stop and think. Here are a couple initial considerations:

With this second post, what I have so far is a flat blog – a single page, to which I’m adding a bit of HTML with each new post. That’s fine for the first few posts, but soon I’ll need to start making each post into its own thing. Because a very long single page with everything over time will lead to scrolling forever and getting harder to find things. Not good! So I need a Post thing that can be viewed on it's own.

And, I also need a way to put several posts (or post excerpts) together on a page (for listing on the home page, and eventually for other kinds of post lists), and each of those entries needs to link to the post itself. So I need a Page thing – like the home page. And maybe (to show excerpts) an Excerpt thing. (Excerpts can probably be put on the backlog for later.)

With the moving things around on multiple pages and in multiple formats comes how to store and retrieve posts and pages and how present them on the site.

And then there is writing the posts. For the first post yesterday I hard-coded the HTML for the whole thing onto the page in a text editor. For this post I’m using Byword, where I can write in markdown format and export to HTML. Then I can paste the html into the existing page. That’s less than ideal. So early on I need a way to insert and edit content. Which implies…

Early on, I need Administrators, or Users who can manage (add(), edit(), and delete()) the content, and who can arrange which content goes on which pages.

For now, the first iteration, let’s just start with making Post and Page happen.


Posted on 20 Mar 2021 9:25 am

Behold, all things have become new. — 2 Corinthians 5.17c

The update to Ghost 4.0 turned out to be unsuitable.

I am starting over from the bare-bones server. The timing, day 1 from the vernal equinox, couldn't be better. New year, new beginning! This post is written in straight-up html. No frills.