Rubber meets the road

Alright, so I've put off creating the build script for long enough. So far, I have three markdown files (including this one) that look enough like posts anyhow, and I'm more than ready to at least attempt to publish something today.

Things I'm addressing now:

Initial deployment

Now that I have a loose spec of sorts, as I have no large binary files I want to host yet, for the first baby step it looks like I can go live just by implementing the markdeep preprocessing capability in my build script:

#!/bin/bash

MARKDEEP_FOOTER='omitted due to code injection issues'
MARKDEEP_HEADER='<meta charset="utf-8"><link rel="stylesheet" href="/resources/slate.css">'

STAGING_DIR="${0%/*}/../stage"
# keeps a staging dir that will be the source for a s3 sync. This source can be used for local web previewing via `python3 -m http.server`.
rm -rf $STAGING_DIR
mkdir -p $STAGING_DIR
cp -r pages resources $STAGING_DIR/
mkdir -p $STAGING_DIR/blog

# Process top-level directories in the blog
for dir in "${0%/*}"/../blog/*/; do
    dir_name=$(basename "$dir")
    output_file="$STAGING_DIR/blog/${dir_name}.md.html"
    
    echo "$MARKDEEP_HEADER" > "$output_file"
    echo "${dir_name}" >> "$output_file"
    echo "===========" >> "$output_file"
    echo "" >> "$output_file"
    
    # Find and process all .deep.md files in the current directory
    find "$dir" -maxdepth 1 -type f -name "*.deep.md" -print0 | sort -z | while IFS= read -r -d '' file; do
        filename=$(basename "$file" .deep.md)
        # echo "## ${filename}" >> "$output_file"
        echo "" >> "$output_file"
        cat "$file" >> "$output_file"
        echo "" >> "$output_file"
    done
    
    echo "$MARKDEEP_FOOTER" >> "$output_file"
done

Only a little bit of experimentation got me here with the templates provided by the author of Markdeep. I then had to change my files quite a bit because there are some differences in whitespace handling in this markdown dialect, but there's nothing wild there. The free inclusion of a table of contents based on headings is welcomed and I decided to use folder structure to auto layout things:

... and so on.

It's a decent format for a blog. But I also know at some point I cannot just have an endless single page. I also have some slight changes I feel like I need to make because here on macOS there are a few pixels of horizontal scroll that the perfectionist in me will not accept. I think this needs a good bit of work to add the kind of flexibility that I will actually need, But it is also a good starting point.

Next up, I will re-evaluate the design from multiple angles and at some point sync to S3 will be implemented which will begin the go-live process!