content: Improve description of the SITE.Home method

This commit is contained in:
Joe Mooring
2025-11-09 09:36:25 -08:00
committed by GitHub
parent 4dfbd647fa
commit 6303f27e14
+15 -1
View File
@@ -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/