Getting Started
Core Concepts
Control
Interactivity
Pushing Data
HTMX Extensions
Miscellaneous
Configuration
Getting Started
- Prerequisites:
- Go 1.2X or above
- Familiarity with https://htmx.org
If you have not read the htmx docs, please do so before continuing, many of the concepts htmgo uses will become clearer.
1. Install htmgo
GOPROXY=direct go install github.com/maddalax/htmgo/cli/htmgo@latest
GOPROXY=direct go install github.com/maddalax/htmgo/cli/htmgo@latestCopy
If you are using Windows, you will need to use the following command instead:
set GOPROXY=direct && go install github.com/maddalax/htmgo/cli/htmgo@latest
set GOPROXY=direct && go install github.com/maddalax/htmgo/cli/htmgo@latestCopy
Make sure GOPROXY=direct is set, otherwise you may have issues.
2. Create new project
htmgo template
htmgo templateCopy
this will ask you for a new app name, and it will clone our starter template to a new directory it creates with your app name.
3. Running the dev server
htmgo watch
htmgo watchCopy
htmgo has built in live reload on the dev server, to use this, run this command in the root of your project
If you prefer to run the dev server yourself (no live reload), use `htmgo run`
4. Building for production
htmgo build
htmgo buildCopy
it will be output to `./dist`