diff --git a/assets/embed/templates/base.tmpl b/assets/embed/templates/base.tmpl index cf1caa36..23fad51c 100644 --- a/assets/embed/templates/base.tmpl +++ b/assets/embed/templates/base.tmpl @@ -7,9 +7,9 @@ - {{ if ne .Config.StyleSheet "" }} + {{ if ne .User.StyleSheet "" }} {{ end }} diff --git a/config/config.go b/config/config.go index e41b59ec..dedac978 100644 --- a/config/config.go +++ b/config/config.go @@ -37,9 +37,7 @@ type UserConfig struct { Rules []*Rule `json:"-"` // Access rules } -// TODO: USE USER StyleSheet -// TODO: USE USER FRONTMATTER -// TODO: USE USER ROOT +// REVIEW: USE USER ROOT // Rule is a dissalow/allow rule type Rule struct { diff --git a/directory/update.go b/directory/update.go index 36ab67f7..ec2d8ce5 100644 --- a/directory/update.go +++ b/directory/update.go @@ -15,7 +15,7 @@ import ( ) // Update is used to update a file that was edited -func (i *Info) Update(w http.ResponseWriter, r *http.Request, c *config.Config) (int, error) { +func (i *Info) Update(w http.ResponseWriter, r *http.Request, c *config.Config, u *config.UserConfig) (int, error) { var data map[string]interface{} kind := r.Header.Get("kind") @@ -45,7 +45,7 @@ func (i *Info) Update(w http.ResponseWriter, r *http.Request, c *config.Config) mainContent = strings.TrimSpace(mainContent) file = []byte(mainContent) case "complete": - if file, code, err = ParseCompleteFile(data, i.Name, c.FrontMatter); err != nil { + if file, code, err = ParseCompleteFile(data, i.Name, u.FrontMatter); err != nil { return http.StatusInternalServerError, err } default: diff --git a/filemanager.go b/filemanager.go index 6ad0f809..ffbb7674 100644 --- a/filemanager.go +++ b/filemanager.go @@ -116,7 +116,7 @@ func (f FileManager) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, err } // Update a file - return fi.Update(w, r, c) + return fi.Update(w, r, c, user) case http.MethodPost: // Upload a new file if r.Header.Get("Upload") == "true" {