Documentation
¶
Overview ¶
Package settings gives typed access to the site settings (a singleton content type registered by fields.Core). Templates see the same values as .Site.<field>.
Index ¶
Constants ¶
const ( SiteName = "siteName" BaseURL = "baseURL" Language = "language" ServerURL = "serverURL" DefaultOGImage = "defaultOgImage" LLMSTxt = "llmsTxt" LLMSContent = "llmsContent" Timezone = "timezone" // MediaMaxMB and MediaMaxVideoMB limit uploads to the media library // (images and PDFs, videos) in MB; empty means the media library's // defaults of 20 and 100 MB. MediaMaxMB = "mediaMaxMB" MediaMaxVideoMB = "mediaMaxVideoMB" )
Field names of the settings type.
const DefaultTimezone = "Europe/Berlin"
DefaultTimezone is used when the settings name none.
const MaxMediaMB = 1024
MaxMediaMB is the largest upload limit the settings accept.
const Type = "settings"
Type is the content type (and slug) of the settings entry.
Variables ¶
This section is empty.
Functions ¶
func ValidBaseURL ¶ added in v0.2.0
ValidBaseURL reports whether s can be the site's base URL: an absolute http(s) URL without credentials, query or fragment. Canonicals, the sitemap and robots.txt are built from it and must be absolute.
func ValidMediaMB ¶ added in v0.6.0
ValidMediaMB reports whether v can be an upload limit: a whole number of MB from 1 to MaxMediaMB.
Types ¶
type Settings ¶
type Settings struct {
SiteName string
BaseURL string // without trailing slash
Language string
ServerURL string // without trailing slash
DefaultOGImage string
LLMSTxt bool
LLMSContent string
// Location is the site's time zone: the admin converts date input with
// it and templates format dates in it.
Location *time.Location
// MediaMaxSize and MediaMaxVideoSize are the upload limits in bytes;
// 0 if not set (or invalid), which means the media library's defaults.
MediaMaxSize, MediaMaxVideoSize int64
Data map[string]any
}
Settings of the site. Data holds all fields, including ones plugins add with Extend.