// Package template provides a high-performance template engine with in-memory // caching, automatic reloading, and advanced template composition features. // // # Basic Usage // // cache := template.NewCache("") // Auto-detects binary location // tmpl, err := cache.Load("page.html") // if err != nil { // log.Fatal(err) // } // // data := map[string]any{ // "title": "Welcome", // "user": map[string]any{ // "name": "Alice", // "email": "alice@example.com", // }, // } // // result := tmpl.RenderNamed(data) // // # Placeholder Types // // Named placeholders: {name}, {title} // // Dot notation: {user.name}, {user.contact.email} // // Positional: {0}, {1}, {2} // // # Template Composition // // Includes - embed other templates with data sharing: // // {include "header.html"} // {include "nav.html"} // // Blocks - define reusable content sections: // // {block "content"} //

Default content

// {/block} // // Yield - template inheritance points: // //
{yield content}
// // // # Template Inheritance Example // // layout.html: // // // // {title} // {yield content} // // // page.html: // // {include "layout.html"} // {block "content"} //

Welcome {user.name}!

// {/block} // // # Advanced Features // // Disable includes for partial rendering: // // opts := RenderOptions{ResolveIncludes: false} // chunk := tmpl.RenderNamedWithOptions(opts, data) // // FastHTTP integration: // // tmpl.WriteTo(ctx, data) // Sets content-type and writes response package template