Skip to content

My personal website written with Templ + HTMx, served by Go (full SSR)

m8rmclaren/website

Repository files navigation

Welcome to my Personal Website

GitHub Actions Workflow Status GitHub Release GitHub top language

View Live · Building Locally

Building Locally

libvips must be installed on the system running the website binary. This library is used by the image optimizer to serve correctly sized images to the browser upon request. libvips is written in C and is dynamically linked to the website binary at compile time. The libvips API is consumed in Go using bindings generated by vipsgen. The bindings are not committed to Git since the version of libvips could vary by system.

# Install libvips & generate bindings
brew install vips pkg-config
go install github.com/cshum/vipsgen/cmd/vipsgen@latest
vipsgen -out ./vips

The website uses templ to render HTML fragments & compose them into cohesive web pages. Templ is a code generator with a pipeline that renders templ files to go files. The generated Go files are not committed to Git & are generated before compiling.

air is a live-reload tool that watches for changes in files & automatically re-compiles the project for dev.

The website uses Tailwind CSS as a utility-first CSS framework and must be installed before air can run.

go install github.com/a-h/templ/cmd/templ@latest
go install github.com/air-verse/air@latest

npm ci

Once dependencies are installed, run init.sh:

./init.sh

# Prompts you to run 'source .env'
source .env

Now you can run dev from your command line as a convenient TUI tool to interact with the website for dev. Use arrow keys and return to interact with the menu.

❯ dev
╭────────────────────────────────────────────────────────────────────────────────────╮
│ Select verb:                             ╭───────────────────────────────────────╮ │
│   2/2 ────────────────────────────────── │ start_website_dev                     │ │
│   Verbs                                  │                                       │ │
│ ▌ start                                  │                                       │ │
│   build                                  │                                       │ │
│                                          │                                       │ │
│                                          │                                       │ │
│                                          │                                       │ │
│                                          │                                       │ │
│                                          │                                       │ │
│                                          │                                       │ │
│                                          │                                       │ │
│                                          │                                       │ │
│                                          │                                       │ │
│                                          │                                       │ │
│                                          │                                       │ │
│                                          ╰───────────────────────────────────────╯ │
╰────────────────────────────────────────────────────────────────────────────────────╯

About

My personal website written with Templ + HTMx, served by Go (full SSR)

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published