Skip to content

Commit 6303f27

Browse files
authored
content: Improve description of the SITE.Home method
1 parent 4dfbd64 commit 6303f27

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

‎content/en/methods/site/Home.md‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,19 @@ params:
99
signatures: [SITE.Home]
1010
---
1111

12-
This method is useful for obtaining a link to the home page.
12+
The `Home` method on a `Site` object is a convenient way to access the home page, and is functionally equivalent to:
13+
14+
```go-html-template
15+
{{ .Site.GetPage "/" }}
16+
```
17+
18+
Because it returns a `Page` object, you can use any of the available [page methods][] by chaining them. For example:
19+
20+
```go-html-template
21+
{{ .Site.Home.Store.Set "greeting" "Hello" }}
22+
```
23+
24+
This method is commonly used to generate a link to the home page. For example:
1325

1426
Site configuration:
1527

@@ -23,3 +35,5 @@ Template:
2335
{{ .Site.Home.Permalink }} → https://example.org/docs/
2436
{{ .Site.Home.RelPermalink }} → /docs/
2537
```
38+
39+
[page methods]: /methods/page/

0 commit comments

Comments
 (0)