feat: console help, examples and named loggers (SummerCMS v0.4.0)

Every command gets long help and examples, descriptions in imperative
sentence case, and a warn-only TestCommandsDocumented over bonfire.CheckDocs.
The plugin logs through a diary component logger instead of the process
default logger. Requires SummerCMS v0.4.0; command names and flags unchanged.
This commit is contained in:
Jakub Zych
2026-10-21 17:33:14 +02:00
parent 48d6593692
commit ffa2c8ffb1
12 changed files with 210 additions and 20 deletions

View File

@@ -2,7 +2,6 @@ package journal
import (
"context"
"log/slog"
"git.golem15.com/golem15/sm-journal-plugin/models"
"git.golem15.com/golem15/summercms/modules/backpack"
@@ -31,7 +30,7 @@ func settingsSearchEnabled(ctx context.Context, db *gorm.DB) bool {
var on bool
err := db.WithContext(ctx).Raw(`SELECT search_use_typesense FROM golem15_journal_settings WHERE id = 1`).Scan(&on).Error
if err != nil {
slog.Default().Warn("journal: search_use_typesense read failed; treating as off", "err", err)
pluginLog.Warn("journal: search_use_typesense read failed; treating as off", "err", err)
return false
}
return on