diff --git a/config/config.go b/config/config.go index 2d86c9e..e27ffb9 100644 --- a/config/config.go +++ b/config/config.go @@ -64,6 +64,7 @@ type ( // Site appearance Theme string `ini:"theme"` + Editor string `ini:"editor"` JSDisabled bool `ini:"disable_js"` WebFonts bool `ini:"webfonts"` Landing string `ini:"landing"` diff --git a/pad.go b/pad.go index 0057299..1545b4f 100644 --- a/pad.go +++ b/pad.go @@ -53,10 +53,17 @@ func handleViewPad(app *App, w http.ResponseWriter, r *http.Request) error { } } - padTmpl := "pad" + padTmpl := app.cfg.App.Editor + if padTmpl == "" { + padTmpl = "pad" + } if action == "" && slug == "" { // Not editing any post; simply render the Pad + if templates[padTmpl] == nil { + log.Info("No template '%s' found. Falling back to default 'pad' template.", padTmpl) + padTmpl = "pad" + } if err = templates[padTmpl].ExecuteTemplate(w, "pad", appData); err != nil { log.Error("Unable to execute template: %v", err) }