package main import ( "fmt" ) func Layout(f map[string]string) string { template := ` %s %s
%s
%s
%s ` return fmt.Sprintf(template, f["title"], f["head"], f["header"], f["main"], f["sidebar"], FooterText, f["bodyBottom"]) } func EditHyphaPage(name, text_mime, content, tags string) string { template := ` ` args := map[string]string{ "title": fmt.Sprintf(TitleTemplate, "Edit "+name), "head": DefaultStyles, "header": `

Edit ` + name + `

`, "main": fmt.Sprintf(template, content, text_mime, "Update "+name, tags), "sidebar": "", "footer": FooterText, } return Layout(args) } func HyphaPage(hyphae map[string]*Hypha, rev Revision, content string) string { template := ` ` args := map[string]string{ "title": fmt.Sprintf(TitleTemplate, rev.FullName), "head": DefaultStyles, "header": DefaultHeader, "main": fmt.Sprintf(template, content), "sidebar": "", "footer": FooterText, } return Layout(args) }