Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(d *deps.Deps, t *internal.TemplateDeps) *internal.FuncsNamespace
Creates a new Namespace and returns a new internal.FuncsNamespace
Types ¶
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace defines the methods for reflect to be used as template functions.
func New ¶
func New(d *deps.Deps, t *internal.TemplateDeps) *Namespace
Creates a new reflect Namespace
func (*Namespace) Base ¶
Base
Returns the current base url.
Example: {{ baseUrl }} Returns: `http://verbiscms.com` (for example)
func (*Namespace) Full ¶
Full
Returns the current full url ¶
Example: {{ fullUrl }} Returns: `http://verbiscms.com/page` (for example)
func (*Namespace) Host ¶
Host
Returns the host of the current url ¶
Example: {{ host }} Returns: `verbiscms.com` (for example)
func (*Namespace) Pagination ¶
Pagination
Gets the page query parameter and returns, if the page query param wasn't found or the string could not be cast to an integer, it will return 1.
Example: {{ paginationPage }}
func (*Namespace) Path ¶
Path
Returns the path of the current url ¶
Example: {{ path }} Returns: `/page` (for example)