This is a base page template. All the other template pages implement this interface. {% interface Page { Title() Content() Script() } %} Page prints a page implementing Page interface. {% func PageTemplate(p Page) %} img | {%= p.Title() %}
{%= p.Content() %}
{%= p.Script() %} {% endfunc %} {% code type BasePage struct {} %} {% func (p *BasePage) Title() %}Empty{% endfunc %} {% func (p *BasePage) Body() %}HelloWorld{% endfunc %} {% func (p *BasePage) Script() %}{% endfunc %}