百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

templ

> 前端框架
开源

一种用 Go 编写 HTML 用户界面的语言。

10.4K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一种用 Go 编写 HTML 用户界面的语言。

## An HTML templating language for Go that has great developer tooling. ## Documentation See user documentation at https://templ.guide

## Tasks ### version-set Set the version of templ to the current version. ```sh version set --template="0.3.%d" ``` ### build Build a local version. ```sh version set --template="0.3.%d" cd cmd/templ go build ``` ### install-snapshot Build and install current version. ```sh # 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 install ``` ### build-snapshot Use goreleaser to build the command line binary using goreleaser. ```sh goreleaser build --snapshot --clean ``` ### generate Run templ generate using local version. ```sh go run ./cmd/templ generate -include-version=false ``` ### test Run Go tests. ```sh version set --template="0.3.%d" go run ./cmd/templ generate -include-version=false go test ./... ``` ### test-short Run Go tests. ```sh version set --template="0.3.%d" go run ./cmd/templ generate -include-version=false go test ./... -short ``` ### test-cover Run Go tests. ``` … ``` ### test-cover-watch interactive: true ```sh gotestsum --watch -- -coverprofile=coverage.out ``` ### test-fuzz ```sh ./parser/v2/fuzz.sh ./parser/v2/goexpression/fuzz.sh ``` ### benchmark Run benchmarks. ```sh go run ./cmd/templ generate -include-version=false && go test ./... -bench=. -benchmem ``` ### fmt Format all Go and templ code. ```sh gofmt -s -w . go run ./cmd/templ fmt . ``` ### lint Run the lint operations that are run as part of the CI. ```sh golangci-lint run --verbose ``` ### ensure-generated Ensure that templ files have been generated with the local version of templ, and that those files have been added to git. Requires: generate ```sh git diff --exit-code ``` ### push-release-tag Push a semantic version number to GitHub to trigger the release process. ```sh version push --template="0.3.%d" --prefix="v" ``` ### docs-run Run the development server. Directory: docs ```sh npm run start ``` ### docs-build Build production docs site. Directory: docs ```sh npm run build ```

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Gogohtml-elementshtmxide-support

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架