Skip to content

Commit

Permalink
docs: update basic syntax example (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
levidurfee authored Sep 28, 2023
1 parent fa2b199 commit 3c6dd16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/docs/03-syntax-and-usage/01-basic-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@ Outside of templ Components, templ files are ordinary Go code.
```templ name="header.templ"
package main
// Ordinary Go code that we can use in our Component.
var greeting = "Welcome!"
// templ Component
templ headerTemplate(name string) {
<header>
<h1>{ name }</h1>
<h2>{ greeting }</h2>
<h2>"{ greeting }" comes from ordinary Go code</h2>
</header>
}
```

0 comments on commit 3c6dd16

Please sign in to comment.