feat: sitemap settings singleton with content types and additional addresses
- one settings tile opening the golem15.sitemap.settings singleton - Files tab (site address, file size, S1 files partial), Additional addresses repeater, Content types tab built from signpost at boot - golem15_sitemap_types; a type switched off leaves the files (reason type) - a save validates (errors.*) and dispatches a rebuild after commit
This commit is contained in:
31
updates/202610280003_create_golem15_sitemap_types.go
Normal file
31
updates/202610280003_create_golem15_sitemap_types.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package updates
|
||||
|
||||
import (
|
||||
"github.com/go-gormigrate/gormigrate/v2"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// createTypes creates golem15_sitemap_types: one row per signpost content
|
||||
// type the settings' Content types tab saved (include, file slug, HTML
|
||||
// sitemap heading per locale). A type without a row uses the defaults.
|
||||
var createTypes = []*gormigrate.Migration{
|
||||
{
|
||||
ID: "202610280003_create_golem15_sitemap_types",
|
||||
Migrate: func(tx *gorm.DB) error {
|
||||
return tx.Exec(`CREATE TABLE golem15_sitemap_types (
|
||||
type_key TEXT PRIMARY KEY,
|
||||
include BOOLEAN NOT NULL DEFAULT TRUE,
|
||||
slug TEXT NOT NULL DEFAULT '',
|
||||
titles JSONB NULL,
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
)`).Error
|
||||
},
|
||||
Rollback: func(tx *gorm.DB) error {
|
||||
return tx.Exec(`DROP TABLE IF EXISTS golem15_sitemap_types`).Error
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
Register(createTypes...)
|
||||
}
|
||||
Reference in New Issue
Block a user