mirror of
https://github.com/gohugoio/hugo.git
synced 2026-09-01 19:22:38 +00:00
content: Improve description of the SITE.Home method
This commit is contained in:
@@ -9,7 +9,19 @@ params:
|
||||
signatures: [SITE.Home]
|
||||
---
|
||||
|
||||
This method is useful for obtaining a link to the home page.
|
||||
The `Home` method on a `Site` object is a convenient way to access the home page, and is functionally equivalent to:
|
||||
|
||||
```go-html-template
|
||||
{{ .Site.GetPage "/" }}
|
||||
```
|
||||
|
||||
Because it returns a `Page` object, you can use any of the available [page methods][] by chaining them. For example:
|
||||
|
||||
```go-html-template
|
||||
{{ .Site.Home.Store.Set "greeting" "Hello" }}
|
||||
```
|
||||
|
||||
This method is commonly used to generate a link to the home page. For example:
|
||||
|
||||
Site configuration:
|
||||
|
||||
@@ -23,3 +35,5 @@ Template:
|
||||
{{ .Site.Home.Permalink }} → https://example.org/docs/
|
||||
{{ .Site.Home.RelPermalink }} → /docs/
|
||||
```
|
||||
|
||||
[page methods]: /methods/page/
|
||||
|
||||
Reference in New Issue
Block a user