working settings

This commit is contained in:
Henrique Dias
2015-09-14 18:18:26 +01:00
parent 4d07761bd5
commit a388b6a025
11 changed files with 187 additions and 65 deletions

View File

@@ -1,4 +1,4 @@
//go:generate go-bindata -pkg assets -o assets/assets.go static/css/ static/js/ templates/
//go:generate go-bindata -pkg assets -o assets/assets.go static/css/ static/js/ templates/ static/
package hugo
@@ -31,8 +31,8 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)
if middleware.Path(r.URL.Path).Matches("/admin") {
page := parseComponents(r)[1]
if page == "assets" {
filename := strings.Replace(r.URL.Path, "/admin/assets", "static", 1)
if page == "static" {
filename := strings.Replace(r.URL.Path, "/admin/", "", 1)
file, err := assets.Asset(filename)
if err != nil {