Documentation ¶
Index ¶
- func ConcatenateStrings(tokens ...string) string
- func DateFormat(s string) template.HTML
- func DateFormatYYYYMMDD(s string) template.HTML
- func DatePeriodFormat(s string) string
- func DomainSetLang(domain string, uri string, language string) string
- func Handler(w http.ResponseWriter, req *http.Request, page interface{}, page2 *model.Page, ...)
- func HasField(data interface{}, name string) bool
- func HumanSize(size string) (string, error)
- func InitLocaleBundle() (*i18n.Bundle, error)
- func InitLocalizer() map[string]*i18n.Localizer
- func Last(x int, a interface{}) bool
- func LegacyDataSetDownloadURI(pageURI, filename string) string
- func Localise(key string, language string, plural int, templateArguments ...string) string
- func Loop(n, m int) []int
- func Markdown(md string) template.HTML
- func NotLastItem(length, index int) bool
- func SafeHTML(s string) template.HTML
- func Slug(s string) string
- func Subtract(x, y int) int
- func TruncateToMaximumCharacters(text string, maxLength int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConcatenateStrings ¶ added in v1.14.0
ConcatenateStrings takes a number of string arguments and concatenates them
func DateFormat ¶ added in v1.9.0
func DateFormatYYYYMMDD ¶ added in v1.9.0
func DatePeriodFormat ¶ added in v1.16.0
DatePeriodFormat will format a time-series date period string to a human accessible format e.g. "2019 JAN-FEB" to "Jan - Feb 2019" "2010 Q1" to "Jan - Mar 2010"
func DomainSetLang ¶ added in v1.9.0
func Handler ¶
func Handler(w http.ResponseWriter, req *http.Request, page interface{}, page2 *model.Page, templateName string, f func(), cfg config.Config)
Handler resolves the rendering of a specific pagem with a given model and template name
func InitLocaleBundle ¶ added in v1.9.0
InitLocaleBundle is used to initialise the locale bundle
func InitLocalizer ¶ added in v1.9.0
InitLocalizer is used to initialise the localizer
func LegacyDataSetDownloadURI ¶ added in v1.9.0
LegacyDataSetDownloadURI builds a URI string for a legacy dataset download URI.
func NotLastItem ¶ added in v1.14.0
NotLastItem returns true/false based on if the index equals the length Example of use is in JSON-LD partials, where we must determine whether or not a comma should be rendered in a range
func TruncateToMaximumCharacters ¶ added in v1.18.0
TruncateToMaximumCharacters returns a substring of parameter 'text' if the text is longer than the specified maximum length
Types ¶
This section is empty.