From d3603ef943a5bdb54bb6a8938384bf6bde0d7595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Mon, 17 Jul 2017 00:01:47 +0200 Subject: [PATCH] Adjust GetPage doc --- content/functions/GetPage.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/content/functions/GetPage.md b/content/functions/GetPage.md index 05f454f83..8d659ce16 100644 --- a/content/functions/GetPage.md +++ b/content/functions/GetPage.md @@ -10,7 +10,7 @@ menu: docs: parent: "functions" #tags: [sections,lists,indexes] -signature: ["GetPage TYPE PATH"] +signature: [".GetPage TYPE PATH"] workson: [] hugoversion: relatedfuncs: [] @@ -20,7 +20,7 @@ aliases: [] Every `Page` has a `Kind` attribute that shows what kind of page it is. While this attribute can be used to list pages of a certain `kind` using `where`, often it can be useful to fetch a single page by its path. -`GetPage` looks up a page of a given `Kind` and `path`. +`.GetPage` looks up a page of a given `Kind` and `path`. ``` {{ with .Site.GetPage "section" "blog" }}{{ .Title }}{{ end }} @@ -34,6 +34,12 @@ For a regular page: {{ with .Site.GetPage "page" "blog" "my-post.md" }}{{ .Title }}{{ end }} ``` +Note that the path can also be supplied like this: + +``` +{{ with .Site.GetPage "page" "blog/my-post.md" }}{{ .Title }}{{ end }} +``` + The valid page kinds are: *page, home, section, taxonomy and taxonomyTerm.* ## `.GetPage` Example