diff options
-rw-r--r-- | config.go | 3 | ||||
-rw-r--r-- | fbfp.scfg.example | 5 | ||||
-rw-r--r-- | main.go | 2 |
3 files changed, 9 insertions, 1 deletions
@@ -37,6 +37,7 @@ import ( var config_with_pointers struct { Url *string `scfg:"url"` + Tmpl *string `scfg:"tmpl"` Static *bool `scfg:"static"` Listen struct { Addr *string `scfg:"addr"` @@ -56,6 +57,7 @@ var config_with_pointers struct { var config struct { Url string + Tmpl string Static bool Listen struct { Addr string @@ -85,6 +87,7 @@ func fbfp_get_config(path string) { * There should be better ways to handle this. */ config.Url = *(config_with_pointers.Url) + config.Tmpl = *(config_with_pointers.Tmpl) config.Static = *(config_with_pointers.Static) config.Listen.Addr = *(config_with_pointers.Listen.Addr) config.Listen.Net = *(config_with_pointers.Listen.Net) diff --git a/fbfp.scfg.example b/fbfp.scfg.example index f726c8b..2868c8e 100644 --- a/fbfp.scfg.example +++ b/fbfp.scfg.example @@ -2,6 +2,11 @@ # and some user-accessible URLs. url http://localhost +# Where is the tmpl directory? Usually this should be a directory inside +# the fbfp source directory, though it might exist in /usr/local/share or +# /usr/share if this ever gets packaged or something. +tmpl tmpl + # Should we serve /static ourself? This should usually be handled by the # upstream Web server such as nginx(8) or OpenBSD httpd(8). However, this might # be useful during development or when running behind relayd(8). @@ -73,7 +73,7 @@ func main() { e(setup_database()) log.Printf("Setting up templates\n") - tmpl = er(template.ParseGlob("tmpl/*")) + tmpl = er(template.ParseGlob(config.Tmpl + "/*")) if config.Static { log.Printf("Registering static handle\n") |