A language for writing HTML user interfaces in Go.
See user documentation at https://templ.guide
Set the version of templ to the current version.
version set --template="0.3.%d"Build a local version.
version set --template="0.3.%d"
cd cmd/templ
go buildBuild and install current version.
# Remove templ from the non-standard ~/bin/templ path
# that this command previously used.
rm -f ~/bin/templ
# Clear LSP logs.
rm -f cmd/templ/lspcmd/*.txt
# Update version.
version set --template="0.3.%d"
# Install to $GOPATH/bin or $HOME/go/bin
cd cmd/templ && go installUse goreleaser to build the command line binary using goreleaser.
goreleaser build --snapshot --cleanRun templ generate using local version.
go run ./cmd/templ generate -include-version=falseRun Go tests.
version set --template="0.3.%d"
go run ./cmd/templ generate -include-version=false
go test ./...Run Go tests.
version set --template="0.3.%d"
go run ./cmd/templ generate -include-version=false
go test ./... -shortRun Go tests.
…interactive: true
gotestsum --watch -- -coverprofile=coverage.out./parser/v2/fuzz.sh
./parser/v2/goexpression/fuzz.shRun benchmarks.
go run ./cmd/templ generate -include-version=false && go test ./... -bench=. -benchmemFormat all Go and templ code.
gofmt -s -w .
go run ./cmd/templ fmt .Run the lint operations that are run as part of the CI.
golangci-lint run --verboseEnsure that templ files have been generated with the local version of templ, and that those files have been added to git.
Requires: generate
git diff --exit-codePush a semantic version number to GitHub to trigger the release process.
version push --template="0.3.%d" --prefix="v"Run the development server.
Directory: docs
npm run startBuild production docs site.
Directory: docs
npm run buildMissing flush in streaming example delays TTFB
proposal: deprecate CSS components in favour of 3rd party CSS pre-processors
VS Code errors: "Files beneath GOMODCACHE must not be replaced."
templ generate fails on a large file
docs: fix suggestion to create your own JSON attribute function when not required
lsp: Support goToDefinition from a Go file to a templ file
fmt: preserve spacing in templates to allow for organizing code
proposal: Deprecate support for go data interpolation inside script tags
[feature request] vscode: quickly open templ files in the integrated browser
Generated code triggers CodeQL go/useless-assignment-to-local for GetChildren fallback