1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-20 02:57:05 +00:00

Added partial templates

mailbox/list now renders
This commit is contained in:
James Hillyerd
2012-10-21 12:42:54 -07:00
parent 9c94bb2ab1
commit 71bb52a64a
17 changed files with 238 additions and 147 deletions

View File

@@ -17,10 +17,11 @@ type SmtpConfig struct {
}
type WebConfig struct {
Ip4address net.IP
Ip4port int
TemplateDir string
PublicDir string
Ip4address net.IP
Ip4port int
TemplateDir string
TemplateCache bool
PublicDir string
}
var smtpConfig *SmtpConfig
@@ -69,6 +70,7 @@ func LoadConfig(filename string) error {
requireOption(messages, "web", "ip4.address")
requireOption(messages, "web", "ip4.port")
requireOption(messages, "web", "template.dir")
requireOption(messages, "web", "template.cache")
requireOption(messages, "web", "public.dir")
requireOption(messages, "datastore", "path")
if messages.Len() > 0 {
@@ -158,6 +160,13 @@ func parseWebConfig() error {
}
webConfig.TemplateDir = str
option = "[web]template.cache"
flag, err := Config.Bool("web", "template.cache")
if err != nil {
return fmt.Errorf("Failed to parse %v: %v", option, err)
}
webConfig.TemplateCache = flag
option = "[web]public.dir"
str, err = Config.String("web", "public.dir")
if err != nil {