From 68c4072bd1d4635effc21f98a21d705bc2a2fb4a Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Wed, 27 Dec 2017 16:00:16 +0000 Subject: [PATCH] fix: hugo full path in URL #288 (#306) --- staticgen/hugo.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/staticgen/hugo.go b/staticgen/hugo.go index 4a12ea77..eb9b5b18 100644 --- a/staticgen/hugo.go +++ b/staticgen/hugo.go @@ -84,7 +84,8 @@ func (h Hugo) Hook(c *fm.Context, w http.ResponseWriter, r *http.Request) (int, return http.StatusForbidden, nil } - filename := filepath.Join(c.User.Scope, r.URL.Path) + filename := filepath.Clean(r.URL.Path) + filename = strings.TrimPrefix(filename, string(filepath.Separator)) archetype := r.Header.Get("archetype") ext := filepath.Ext(filename)