feat: site languages, setup and site URL settings

This commit is contained in:
Florian Sylvain committed 2026-11-01 22:13:02 +01:00
1 parent 0806733d5c
commit d9158025d4
106 files changed
+10184 -56

No files matched your search

+9
View File
@@ -20,6 +20,13 @@ var (
ErrInvalidReassign = errors.New("invalid reassign destination")
ErrInvalidTitleTemplate = errors.New("the title template must contain %title%")
ErrInvalidPublicURLPattern = errors.New("invalid public url pattern")
ErrPublicURLScheme = errors.New("the public url pattern must start with https:// or http://")
ErrPublicURLHost = errors.New("the public url pattern must have a host")
ErrPublicURLPlaceholder = errors.New("the public url pattern has an unknown placeholder")
ErrPublicURLNotEncoded = errors.New("the public url pattern has characters that need encoding")
ErrPublicURLMissingSlug = errors.New("the public url pattern must contain {slug}")
)
const (
@@ -60,6 +67,7 @@ type Site struct {
SiteName string `json:"site_name"`
TitleTemplate string `json:"title_template"`
DefaultDescription string `json:"default_description"`
PublicURLPattern *string `json:"public_url_pattern"`
}
type Nullable[T any] struct {
@@ -78,6 +86,7 @@ type Patch struct {
SiteName *string
TitleTemplate *string
DefaultDescription *string
PublicURLPattern Nullable[string]
}
func IsValidKey(key string) bool {