HUGO
News Docs Themes Community GitHub

Role

Returns the role object for the given site.

Syntax

SITE.Role

Returns

roles.RoleSite
New in v0.153.0

The Role method on a Site object returns the role object for the given site. The role object is derived from the role definition in the site configuration.

Methods

IsDefault

(bool) Reports whether this is the default role object as defined by the defaultContentRole setting in the site configuration.

{{ .Site.Role.IsDefault }} → true

Name

(string) Returns the role name. This is the lower cased key from the site configuration.

{{ .Site.Role.Name }} → guest