diff --git a/projects/templ.guide/hello.templ b/projects/templ.guide/hello.templ new file mode 100644 index 00000000..15ce7396 --- /dev/null +++ b/projects/templ.guide/hello.templ @@ -0,0 +1,5 @@ +package main + +templ hello(name string) { +
Hello, { name }
+} diff --git a/projects/templ.guide/package.yml b/projects/templ.guide/package.yml new file mode 100644 index 00000000..0377ccbd --- /dev/null +++ b/projects/templ.guide/package.yml @@ -0,0 +1,30 @@ +distributable: + url: https://github.com/a-h/templ/archive/refs/tags/v{{version}}.tar.gz + strip-components: 1 + +versions: + github: a-h/templ + strip: /^v/ + +build: + dependencies: + go.dev: ^1.20 + env: + CGO_ENABLED: 0 + LDFLAGS: + - -extldflags=-static + - -w + - -s + script: + - go build -v -ldflags="$LDFLAGS" -o templ ./cmd/templ + - mkdir -p "{{ prefix }}"/bin + - mv templ "{{ prefix }}"/bin + +provides: + - bin/templ + +test: + script: + - test "$(templ --version)" = {{version}} + - templ generate + - test -f hello_templ.go