-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example of the powerful 'templ' generated templates
- Loading branch information
Showing
9 changed files
with
359 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
module github.com/kataras/iris/v12/_examples/view/templ | ||
|
||
go 1.21 | ||
|
||
replace github.com/kataras/iris/v12 => ../../../ | ||
|
||
require ( | ||
github.com/a-h/templ v0.2.476 | ||
github.com/kataras/iris/v12 v12.2.9-0.20231212220110-7ffe4010b957 | ||
) | ||
|
||
require ( | ||
github.com/BurntSushi/toml v1.3.2 // indirect | ||
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 // indirect | ||
github.com/CloudyKit/jet/v6 v6.2.0 // indirect | ||
github.com/Joker/jade v1.1.3 // indirect | ||
github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 // indirect | ||
github.com/andybalholm/brotli v1.0.6 // indirect | ||
github.com/aymerick/douceur v0.2.0 // indirect | ||
github.com/fatih/structs v1.1.0 // indirect | ||
github.com/flosch/pongo2/v4 v4.0.2 // indirect | ||
github.com/golang/snappy v0.0.4 // indirect | ||
github.com/gomarkdown/markdown v0.0.0-20230922112808-5421fefb8386 // indirect | ||
github.com/google/uuid v1.4.0 // indirect | ||
github.com/gorilla/css v1.0.0 // indirect | ||
github.com/iris-contrib/schema v0.0.6 // indirect | ||
github.com/josharian/intern v1.0.0 // indirect | ||
github.com/kataras/blocks v0.0.8 // indirect | ||
github.com/kataras/golog v0.1.11 // indirect | ||
github.com/kataras/pio v0.0.13 // indirect | ||
github.com/kataras/sitemap v0.0.6 // indirect | ||
github.com/kataras/tunnel v0.0.4 // indirect | ||
github.com/klauspost/compress v1.17.4 // indirect | ||
github.com/mailgun/raymond/v2 v2.0.48 // indirect | ||
github.com/mailru/easyjson v0.7.7 // indirect | ||
github.com/microcosm-cc/bluemonday v1.0.26 // indirect | ||
github.com/russross/blackfriday/v2 v2.1.0 // indirect | ||
github.com/schollz/closestmatch v2.1.0+incompatible // indirect | ||
github.com/sirupsen/logrus v1.8.1 // indirect | ||
github.com/tdewolff/minify/v2 v2.20.9 // indirect | ||
github.com/tdewolff/parse/v2 v2.7.6 // indirect | ||
github.com/valyala/bytebufferpool v1.0.0 // indirect | ||
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect | ||
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect | ||
github.com/yosssi/ace v0.0.5 // indirect | ||
golang.org/x/crypto v0.16.0 // indirect | ||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect | ||
golang.org/x/net v0.19.0 // indirect | ||
golang.org/x/sys v0.15.0 // indirect | ||
golang.org/x/text v0.14.0 // indirect | ||
golang.org/x/time v0.5.0 // indirect | ||
google.golang.org/protobuf v1.31.0 // indirect | ||
gopkg.in/ini.v1 v1.67.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package main | ||
|
||
templ hello(name string) { | ||
<div>Hello, <strong>{ name }</strong></div> | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/kataras/iris/v12" | ||
) | ||
|
||
// 1. | ||
// $ go install github.com/a-h/templ/cmd/templ@latest | ||
// $ templ generate | ||
// $ go run . | ||
func main() { | ||
component := hello("Makis") | ||
|
||
app := iris.New() | ||
app.Get("/", iris.Component(component)) | ||
|
||
app.Listen(":8080") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters