HUGO
News Docs Themes Community GitHub

Home

Returns the home Page object for the given site.

Syntax

SITE.Home

Returns

page.Page

The Home method on a Site object is a convenient way to access the home page, and is functionally equivalent to:

{{ .Site.GetPage "/" }}

Because it returns a Page object, you can use any of the available page methods by chaining them. For example:

{{ .Site.Home.Store.Set "greeting" "Hello" }}

This method is commonly used to generate a link to the home page. For example:

Site configuration:

baseURL: https://example.org/docs/
baseURL = 'https://example.org/docs/'
{
   "baseURL": "https://example.org/docs/"
}

Template:

{{ .Site.Home.Permalink }} → https://example.org/docs/ 
{{ .Site.Home.RelPermalink }} → /docs/