func test() templ.Component {
comp := templ() {
<div>content</div>
}
return comp()
}
For a less contrived use case: I want to attach some metadata to my pages, basically frontmatter, and it'd be nice to be able to do things inline.
Right now, this works:
templ myPage(fr pagedb.Front) {
if fr.Bool("isReal") {
<div>I'm a real boy!</div>
} else {
<div>sadly just a puppet...</div>
}
}
func init() {
pagedb.Register(myPage(), map[string]any{
"meta": "data",
"isReal": false,
})
}
But being able to put it inline would unlock a few things when it comes to mimicking the workflow / format of other frontmatter site systems.
For a less contrived use case: I want to attach some metadata to my pages, basically frontmatter, and it'd be nice to be able to do things inline.
Right now, this works:
But being able to put it inline would unlock a few things when it comes to mimicking the workflow / format of other frontmatter site systems.