Skip to content

E0721: A page whose markup is written in Go ​

A page under pages/ is a .vuka.html file: its struct, hooks and methods in its <script lang="go">, its markup below. The page's struct is declared in a .go or .vuka file instead, rendering with a Render or View method written by hand. Rendering is written in .vuka.html files only; .go and .vuka files under pages/ hold logic — guards, middleware, endpoints, helpers.

Wrong ​

go
// pages/employers/new.go
type New struct{}

func (p *New) Render(ctx context.Context, w io.Writer) error {
	return ui.HTML(`<h1>New employer</h1>`).Render(ctx, w)
}
html
<!-- pages/employers/new.vuka.html -->
<script lang="go">
package employers

type New struct{}
</script>

<h1>New employer</h1>

Released under the MIT License. Vuka builds on Go and its tools, which are made by the Go Authors. Vuka is not affiliated with Google or the Go project. Go is a trademark of Google LLC.