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:
Jakub Zych
2026-11-04 11:06:29 +01:00
parent 3359f1a196
commit 3ba70bb69f
20 changed files with 1304 additions and 337 deletions

27
models/type_setting.go Normal file
View File

@@ -0,0 +1,27 @@
package models
import (
"time"
"git.golem15.com/golem15/summercms/modules/lagoon"
)
// TypeSetting is the sitemap's setting of one signpost content type on
// golem15_sitemap_types, edited on the settings singleton's Content types
// tab: whether its records are listed, the file name part of its group
// (sitemap-<slug>-<n>.xml; "" means the default) and its heading per locale
// in the HTML sitemap. A type without a row is listed under its default
// slug.
type TypeSetting struct {
TypeKey string `gorm:"column:type_key;primaryKey"`
Include bool `gorm:"column:include"`
Slug string `gorm:"column:slug"`
Titles lagoon.Jsonable[map[string]string] `gorm:"column:titles"`
UpdatedAt time.Time `gorm:"column:updated_at"`
}
func (TypeSetting) TableName() string { return "golem15_sitemap_types" }
func init() {
Register(TypeSetting{})
}