Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

templ

> 前端框架
Open source

A language for writing HTML user interfaces in Go.

10.4K stars0 likes2 views
WebsiteGitHub

About

A language for writing HTML user interfaces in Go.

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.

bash
version set --template="0.3.%d"

build

Build a local version.

bash
version set --template="0.3.%d"
cd cmd/templ
go build

install-snapshot

Build and install current version.

bash
# 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.

bash
goreleaser build --snapshot --clean

generate

Run templ generate using local version.

bash
go run ./cmd/templ generate -include-version=false

test

Run Go tests.

bash
version set --template="0.3.%d"
go run ./cmd/templ generate -include-version=false
go test ./...

test-short

Run Go tests.

bash
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

bash
gotestsum --watch -- -coverprofile=coverage.out

test-fuzz

bash
./parser/v2/fuzz.sh
./parser/v2/goexpression/fuzz.sh

benchmark

Run benchmarks.

bash
go run ./cmd/templ generate -include-version=false && go test ./... -bench=. -benchmem

fmt

Format all Go and templ code.

bash
gofmt -s -w .
go run ./cmd/templ fmt .

lint

Run the lint operations that are run as part of the CI.

bash
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

bash
git diff --exit-code

push-release-tag

Push a semantic version number to GitHub to trigger the release process.

bash
version push --template="0.3.%d" --prefix="v"

docs-run

Run the development server.

Directory: docs

bash
npm run start

docs-build

Build production docs site.

Directory: docs

bash
npm run build

Issues· 40 open

View all issuesOpen on GitHub
  • #1331

    Missing flush in streaming example delays TTFB

    Updated Sep 20, 2026
  • #740

    proposal: deprecate CSS components in favour of 3rd party CSS pre-processors

    Updated Sep 2, 2026
  • #1438

    VS Code errors: "Files beneath GOMODCACHE must not be replaced."

    Updated Aug 3, 2026
  • #1049

    templ generate fails on a large file

    Updated Jul 24, 2026
  • #1435

    docs: fix suggestion to create your own JSON attribute function when not required

    Updated Jul 24, 2026
  • #387

    lsp: Support goToDefinition from a Go file to a templ file

    Updated Jul 15, 2026
  • #374

    fmt: preserve spacing in templates to allow for organizing code

    Updated Jul 1, 2026
  • #1408

    proposal: Deprecate support for go data interpolation inside script tags

    Updated Jun 10, 2026
  • #1397

    [feature request] vscode: quickly open templ files in the integrated browser

    Updated May 20, 2026
  • #1393

    Generated code triggers CodeQL go/useless-assignment-to-local for GetChildren fallback

    Updated May 18, 2026

> Tags

Gogohtml-elementshtmxide-support

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category前端框架
PricingOpen source

> Related tools

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