features/templ-components #3

Merged
jtom38 merged 17 commits from features/templ-components into main 2024-07-13 10:40:28 -07:00
3 changed files with 28 additions and 2 deletions
Showing only changes of commit 174516f34f - Show all commits

View File

@ -1,4 +1,4 @@
package templhtml
package html
templ Br(){
<br/>

View File

@ -1,4 +1,4 @@
package templhtml
package html
templ ALink(url, title string) {
<a href={ templ.SafeURL(url) }>{ title }</a>

View File

@ -0,0 +1,26 @@
package html
templ Doctype() {
<!DOCTYPE html>
}
// Creates <html> that accepts children
templ New(lang string) {
<html lang={ lang }>
{ children... }
</html>
}
// Creates <head> that accepts children
templ NewHeader() {
<head>
{ children... }
</head>
}
// Creates <body> that accepts children
templ NewBody() {
<body>
{ children... }
</body>
}