gust1n / go-render

A convenience template loader for go(lang) templates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yield/Parent functionality

gust1n opened this issue · comments

I would like something like {{ yield }} to have both default content and the extended. Like

base.html
{{ template "sidebar" . }}
{{ define "sidebar" }}
Default sidebar
{{ end }}

child.html
{{ define "sidebar" }}
{{ parent }}
Child sidebar
{{ end }}

producing:
Default sidebar
Child sidebar