fix some bugs and add stuff to config

This commit is contained in:
Henrique Dias
2016-08-21 20:25:40 +01:00
parent 8d0214f74a
commit 408fa2e86f
3 changed files with 7 additions and 8 deletions

View File

@@ -70,7 +70,8 @@ func Parse(c *caddy.Controller) ([]Config, error) {
for c.Next() {
var cfg = Config{UserConfig: &UserConfig{}}
cfg.PathScope = "./"
cfg.PathScope = "."
cfg.Root = http.Dir(cfg.PathScope)
cfg.BaseURL = ""
cfg.FrontMatter = "yaml"
cfg.HugoEnabled = false
@@ -235,8 +236,6 @@ func Parse(c *caddy.Controller) ([]Config, error) {
cfg.BaseURL = strings.TrimSuffix(cfg.BaseURL, "/")
cfg.BaseURL = "/" + cfg.BaseURL
cfg.Root = http.Dir(cfg.PathScope)
caddyConf := httpserver.GetConfig(c)
cfg.AbsoluteURL = strings.TrimSuffix(caddyConf.Addr.Path, "/") + "/" + cfg.BaseURL
cfg.AbsoluteURL = strings.Replace(cfg.AbsoluteURL, "//", "/", -1)