render

package
v1.58.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add added in v1.37.0

func Add(x, y int) int

func ConcatenateStrings added in v1.14.0

func ConcatenateStrings(tokens ...string) string

ConcatenateStrings takes a number of string arguments and concatenates them

func DateFormat added in v1.9.0

func DateFormat(s string) template.HTML

func DateFormatYYYYMMDD added in v1.9.0

func DateFormatYYYYMMDD(s string) template.HTML

func DateFormatYYYYMMDDNoSlash added in v1.48.0

func DateFormatYYYYMMDDNoSlash(s string) template.HTML

func DatePeriodFormat added in v1.16.0

func DatePeriodFormat(s string) string

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 DomainSetLang(domain string, uri string, language string) string

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 HasField added in v1.14.0

func HasField(data interface{}, name string) bool

HasField checks to see if the field is present in the struct

func HumanSize added in v1.9.0

func HumanSize(size string) (string, error)

func InitLocaleBundle added in v1.9.0

func InitLocaleBundle() (*i18n.Bundle, error)

InitLocaleBundle is used to initialise the locale bundle

func InitLocalizer added in v1.9.0

func InitLocalizer() map[string]*i18n.Localizer

InitLocalizer is used to initialise the localizer

func Last added in v1.9.0

func Last(x int, a interface{}) bool

func LegacyDataSetDownloadURI added in v1.9.0

func LegacyDataSetDownloadURI(pageURI, filename string) string

LegacyDataSetDownloadURI builds a URI string for a legacy dataset download URI.

func Localise added in v1.9.0

func Localise(key string, language string, plural int, templateArguments ...string) string

Localise localises text based on a key

func Loop added in v1.9.0

func Loop(n, m int) []int

func Markdown added in v1.9.0

func Markdown(md string) template.HTML

Markdown converts markdown to HTML

func Multiply added in v1.48.0

func Multiply(x, y int) int

func NotLastItem added in v1.14.0

func NotLastItem(length, index int) bool

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 SafeHTML added in v1.9.0

func SafeHTML(s string) template.HTML

func Slug added in v1.9.0

func Slug(s string) string

func Subtract added in v1.9.0

func Subtract(x, y int) int

func TruncateToMaximumCharacters added in v1.18.0

func TruncateToMaximumCharacters(text string, maxLength int) string

TruncateToMaximumCharacters returns a substring of parameter 'text' if the text is longer than the specified maximum length

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL