Skip to content

Commit

Permalink
improve readme navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
crhntr authored Aug 18, 2024
1 parent af653f1 commit df047b8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# MUXT lets you register HTTP routes from your Go HTML Templates [![Go Reference](https://pkg.go.dev/badge/github.com/crhntr/muxt.svg)](https://pkg.go.dev/github.com/crhntr/muxt) [![Go](https://github.com/crhntr/muxt/actions/workflows/go.yml/badge.svg)](https://github.com/crhntr/muxt/actions/workflows/go.yml)
# Muxt facilitates improved locality of behavior by letting you register HTTP routes in your templates [![Go Reference](https://pkg.go.dev/badge/github.com/crhntr/muxt.svg)](https://pkg.go.dev/github.com/crhntr/muxt) [![Go](https://github.com/crhntr/muxt/actions/workflows/go.yml/badge.svg)](https://github.com/crhntr/muxt/actions/workflows/go.yml)

This is especially helpful when you are writing HTMX.

Given the following files
Given [main.go](#main_go) and [index.gohtml](#index_gohtml), muxt will generate [template_routes.go](#template_routes_go).

### main.go
### <span id='main_go'></span> main.go
```go
package main

Expand Down Expand Up @@ -78,7 +78,7 @@ func main() {
}
```

### index.gohtml
### <span id='index_gohtml'></span> index.gohtml
```html
<!DOCTYPE html>
<html lang="en">
Expand Down Expand Up @@ -158,7 +158,7 @@ func main() {
{{end}}
```

### template_routes.go
### <span id='template_routes_go'></span> template_routes.go
This file is generated by running `go generate` in the same directory as `main.go`
```go
// Code generated by muxt. DO NOT EDIT.
Expand Down Expand Up @@ -207,4 +207,4 @@ func execute(response http.ResponseWriter, request *http.Request, t *template.Te
response.WriteHeader(code)
_, _ = buf.WriteTo(response)
}
```
```

0 comments on commit df047b8

Please sign in to comment.