An open API service indexing awesome lists of open source software.

https://github.com/m8rmclaren/website

My personal website written with Templ + HTMx, served by Go (full SSR)
https://github.com/m8rmclaren/website

go-echo htmx ssr templ

Last synced: 4 months ago
JSON representation

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

Awesome Lists containing this project

README

          


Welcome to my Personal Website



GitHub Actions Workflow Status
GitHub Release
GitHub top language




View Live

·

Building Locally

## Building Locally

[`libvips`](https://github.com/libvips/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](https://github.com/cshum/vipsgen). The bindings are not committed to Git since the version of `libvips`
could vary by system.

```shell
# 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`](https://templ.guide/) 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`](https://github.com/air-verse/air) is a live-reload tool that watches for changes in files & automatically
re-compiles the project for dev.

The website uses [Tailwind CSS](https://tailwindcss.com/docs/installation/tailwind-cli) as a utility-first CSS framework
and must be installed before `air` can run.

```shell
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`:

```shell
./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.
```shell
❯ dev
╭────────────────────────────────────────────────────────────────────────────────────╮
│ Select verb: ╭───────────────────────────────────────╮ │
│ 2/2 ────────────────────────────────── │ start_website_dev │ │
│ Verbs │ │ │
│ ▌ start │ │ │
│ build │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ ╰───────────────────────────────────────╯ │
╰────────────────────────────────────────────────────────────────────────────────────╯
```