1
0
mirror of https://github.com/writeas/writefreely synced 2025-02-09 12:58:37 +01:00

Merge pull request #153 from writeas/configurable-editor

Add editor config option
This commit is contained in:
Matt Baer 2019-08-08 07:33:04 -04:00 committed by GitHub
commit 8557119451
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -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"`

9
pad.go
View File

@ -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)
}