KIEL'S JOURNAL
Dark Mode

WRITING

Blogging with Jekyll

January 26, 2022

Since this site is built using Jekyll, it’s handy to have some documentation here about how things work. I’m hopeful that once I get the structure of this site built out, I can focus on writing.

This post might also serve as a playground for seeing how I can build better posts.

Date Formatting

Dates are formatted in Ruby using strftime. For example, when I wrote this, it was Wednesday, January 26, 2022. That date was inserted into the current page using:

page.date | date: "%A, %B %d, %Y"

Other languages–such as C, Python, and PHP–also use this format.

Syntax Highlighting

This is the biggest attraction I have to using Jekyll. The syntax highlighting built into WordPress grew frustrating to use. Jekyll uses Rouge which has wide language support. For example, here’s an assembly program:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
    processor 6502

    seg code
    org $F000       ; Define the code origin at $F000

Start:
    sei             ; Disable interrupts
    cld             ; Disable the BCD decimal math mode
    ldx #$FF        ; Loads the X register with #$FF
    txs             ; Transfer the X register to the (S)tack pointer

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Clear the Page Zero region ($00 to $FF)
; Meaning the entire RAM and also the entire TIA registers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    lda #0          ; A = 0
    tax             ; X = A
MemLoop:
    dex             ; X--
    sta $0,X        ; Store the value of A inside memory address $0 + X
    bne MemLoop     ; Loop until X is equal to zero (z-flag is set)

Spin:
    jmp Spin        ; Loop forever

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Fill the ROM size to exactly 4KB
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    org $FFFC
    .word Start     ; Reset vector at $FFFC (where the program starts)
    .word Start     ; Interrupt vector at $FFFE (unused in the VCS)

Inline Images

I write a lot of posts that need some sort of explanatory picture. Such as:

my screenshot A screenshot of Visual Studio Code

The code to include that looks like:

![my screenshot](/assets/images/2022-01-26-screenshot-1.png)
*A screenshot of Visual Studio Code*

A caption is added to the picture by putting emphasis on the text.