hugo: github.com/spf13/hugo/tpl/inflect Index | Files

package inflect

import "github.com/spf13/hugo/tpl/inflect"

Index

Package Files

inflect.go init.go

type Namespace Uses

type Namespace struct{}

Namespace provides template functions for the "inflect" namespace.

func New Uses

func New() *Namespace

New returns a new instance of the inflect-namespaced template functions.

func (*Namespace) Humanize Uses

func (ns *Namespace) Humanize(in interface{}) (string, error)

Humanize returns the humanized form of a single parameter.

If the parameter is either an integer or a string containing an integer value, the behavior is to add the appropriate ordinal.

Example:  "my-first-post" -> "My first post"
Example:  "103" -> "103rd"
Example:  52 -> "52nd"

func (*Namespace) Pluralize Uses

func (ns *Namespace) Pluralize(in interface{}) (string, error)

Pluralize returns the plural form of a single word.

func (*Namespace) Singularize Uses

func (ns *Namespace) Singularize(in interface{}) (string, error)

Singularize returns the singular form of a single word.

Package inflect imports 5 packages (graph) and is imported by 1 packages. Updated 2017-05-22. Refresh now. Tools for package owners.