2024-09-20 17:18:22 +00:00
|
|
|
## **Getting Started**
|
|
|
|
|
|
|
|
|
|
|
2024-09-23 19:41:43 +00:00
|
|
|
##### **Prerequisites:**
|
2024-09-24 19:51:46 +00:00
|
|
|
1. Go: https://go.dev/doc/install
|
|
|
|
|
2. Familiarity with https://htmx.org and html/hypermedia
|
|
|
|
|
1. If you have not read the htmx docs, please do so before continuting, a lot of concepts below will be much more clear after.
|
|
|
|
|
|
|
|
|
|
|
2024-09-23 19:41:43 +00:00
|
|
|
<br>
|
2024-09-20 17:18:22 +00:00
|
|
|
|
|
|
|
|
##### 1. **Install htmgo**
|
|
|
|
|
|
|
|
|
|
```bash
|
2024-09-26 20:41:57 +00:00
|
|
|
GOPROXY=direct go install github.com/maddalax/htmgo/cli/htmgo@latest
|
2024-09-20 17:18:22 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**2. Create new project**
|
|
|
|
|
Once htmgo cli tool is installed, run
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
htmgo template
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
2024-09-24 17:39:16 +00:00
|
|
|
<br>
|
2024-09-20 17:18:22 +00:00
|
|
|
|
|
|
|
|
**3. Running the dev server**
|
|
|
|
|
htmgo has built in live reload on the dev server, to use this, run this command in the root of your project
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
htmgo watch
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
If you prefer to restart the dev server yourself (no live reload), use
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
htmgo run
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
##### **4. Core concepts**
|
|
|
|
|
|
2024-09-24 17:39:16 +00:00
|
|
|
View the [core concepts](/docs#core-concepts-pages) of how to use htmgo, such as adding pages, using partials, routing, etc.
|
2024-09-20 17:18:22 +00:00
|
|
|
|
2024-09-24 17:39:16 +00:00
|
|
|
<br>
|
2024-09-20 17:18:22 +00:00
|
|
|
|
|
|
|
|
**5. Building for production**
|
|
|
|
|
htmgo cli can be used to build the application for production as a single binary
|
2024-09-20 16:45:23 +00:00
|
|
|
|
|
|
|
|
```bash
|
2024-09-20 17:18:22 +00:00
|
|
|
htmgo build
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
it will be output to **./dist**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<br>
|