diff options
Diffstat (limited to 'docs/content/en/methods/page/InSection.md')
-rw-r--r-- | docs/content/en/methods/page/InSection.md | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/docs/content/en/methods/page/InSection.md b/docs/content/en/methods/page/InSection.md index 904f6ce75..adca82d86 100644 --- a/docs/content/en/methods/page/InSection.md +++ b/docs/content/en/methods/page/InSection.md @@ -3,24 +3,16 @@ title: InSection description: Reports whether the given page is in the given section. categories: [] keywords: [] -action: - related: - - methods/page/Ancestors - - methods/page/CurrentSection - - methods/page/FirstSection - - methods/page/IsAncestor - - methods/page/IsDescendant - - methods/page/Parent - - methods/page/Sections - returnType: bool - signatures: [PAGE.InSection SECTION] -toc: true +params: + functions_and_methods: + returnType: bool + signatures: [PAGE.InSection SECTION] --- -The `InSection` method on a `Page` object reports whether the given page is in the given section. Note that the method returns `true` when comparing a page to a sibling. - {{% glossary-term section %}} +The `InSection` method on a `Page` object reports whether the given page is in the given section. Note that the method returns `true` when comparing a page to a sibling. + With this content structure: ```text @@ -83,9 +75,8 @@ Inside of the `with` block, the [context](g) (the dot) is the section `Page` obj The result would be wrong when rendering the "auction-1" page because we are comparing the section page to itself. -{{% note %}} -Use the `$` to get the context passed into the template. -{{% /note %}} +> [!note] +> Use the `$` to get the context passed into the template. ```go-html-template {{ with .Site.GetPage "/auctions" }} @@ -93,9 +84,8 @@ Use the `$` to get the context passed into the template. {{ end }} ``` -{{% note %}} -Gaining a thorough understanding of context is critical for anyone writing template code. -{{% /note %}} +> [!note] +> Gaining a thorough understanding of context is critical for anyone writing template code. -[`with`]: /functions/go-template/with/ [`else`]: /functions/go-template/else/ +[`with`]: /functions/go-template/with/ |