feat: H1 conversion on the API, markdown and import paths
- the /_journal/api/v1 post writes convert default and translated content in the write transaction and answer an additive notices key - journal:import-posts converts and prints the converted count (ImportFromDirConfig, ImportStats.H1Converted) - a category's pillar text saved in the admin answers editor.h1_converted_category - every GET /categories row reports content_h1_to_h2 (additive key)
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
translatemodels "git.golem15.com/golem15/sm-translate-plugin/models"
|
||||
"git.golem15.com/golem15/summercms/modules/backpack"
|
||||
"git.golem15.com/golem15/summercms/modules/bonfire"
|
||||
"git.golem15.com/golem15/summercms/modules/compass"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -251,6 +252,14 @@ func isEmptyValue(v any) bool {
|
||||
return ok && s == ""
|
||||
}
|
||||
|
||||
// appConfig is app's config, nil without an application.
|
||||
func appConfig(app *backpack.App) *compass.Config {
|
||||
if app == nil {
|
||||
return nil
|
||||
}
|
||||
return app.Config
|
||||
}
|
||||
|
||||
func mustDB(app *backpack.App) *gorm.DB {
|
||||
if app == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user