updates and grunt
This commit is contained in:
9
hugo.go
9
hugo.go
@@ -1,8 +1,9 @@
|
||||
//go:generate go-bindata -pkg assets -o assets/assets.go static/css/ static/js/ templates/ static/
|
||||
//go:generate go-bindata -pkg assets -o assets/assets.go templates/ assets/dist/css/ assets/dist/js/
|
||||
|
||||
package hugo
|
||||
|
||||
import (
|
||||
"log"
|
||||
"mime"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
@@ -33,8 +34,10 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)
|
||||
if middleware.Path(r.URL.Path).Matches("/admin") {
|
||||
page := utils.ParseComponents(r)[1]
|
||||
|
||||
if page == "static" {
|
||||
filename := strings.Replace(r.URL.Path, "/admin/", "", 1)
|
||||
log.Print(page)
|
||||
|
||||
if page == "assets" {
|
||||
filename := strings.Replace(r.URL.Path, "/admin/assets/", "assets/dist/", 1)
|
||||
file, err := assets.Asset(filename)
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user