Remove variables section

See #2196
This commit is contained in:
Joe Mooring 2024-02-03 15:07:29 -08:00 committed by Bjørn Erik Pedersen
parent 313b1d85e6
commit 9f9a9315f8
13 changed files with 9 additions and 309 deletions

View File

@ -48,33 +48,27 @@ weight = 80
identifier = 'methods'
pageRef = '/methods/'
[[docs]]
name = 'Variables'
weight = 90
identifier = 'variables'
pageRef = '/variables/'
[[docs]]
name = 'Render hooks'
weight = 100
weight = 90
identifier = 'render-hooks'
pageRef = '/render-hooks/'
[[docs]]
name = 'Hugo Modules'
weight = 110
weight = 100
identifier = 'modules'
pageRef = '/hugo-modules/'
[[docs]]
name = 'Hugo Pipes'
weight = 120
weight = 110
identifier = 'hugo-pipes'
pageRef = '/hugo-pipes/'
[[docs]]
name = 'CLI'
weight = 130
weight = 120
post = 'break'
identifier = 'commands'
pageRef = '/commands/'
@ -83,25 +77,25 @@ pageRef = '/commands/'
[[docs]]
name = 'Troubleshooting'
weight = 140
weight = 130
identifier = 'troubleshooting'
pageRef = '/troubleshooting/'
[[docs]]
name = 'Developer tools'
weight = 150
weight = 140
identifier = 'developer-tools'
pageRef = '/tools/'
[[docs]]
name = 'Hosting and deployment'
weight = 160
weight = 150
identifier = 'hosting-and-deployment'
pageRef = '/hosting-and-deployment/'
[[docs]]
name = 'Contribute'
weight = 170
weight = 160
post = 'break'
identifier = 'contribute'
pageRef = '/contribute/'

View File

@ -11,6 +11,7 @@ menu:
weight: 10
weight: 10
showSectionMenu: true
aliases: ['/variables/']
---
Use these methods within your templates.

View File

@ -1,13 +0,0 @@
---
cascade:
_build:
list: never
publishResources: false
render: never
---
<!--
Files within this headless branch bundle are markdown snippets. Each file must contain front matter delimiters, though front matter fields are not required.
Include the rendered content using the "include" shortcode.
-->

View File

@ -1,20 +0,0 @@
---
# Do not remove front matter.
---
{{% note %}}
We are making an effort to unify our [terminology], and to use these terms consistently throughout the documentation.
Historically, we have inconsistently referred to the items on this page as [functions], [parameters], [variables], or [methods]. They are not functions, parameters, or variables; they are methods.
This page will remain in place as readers become familiar with the unified terminology. See the [methods section] for a list of methods by [object], or the [methods quick reference guide].
[functions]: /getting-started/glossary/#function
[methods quick reference guide]: /quick-reference/methods/
[methods section]: /methods/
[methods]: /getting-started/glossary/#method
[object]: /getting-started/glossary/#object
[parameters]: /getting-started/glossary/#parameter
[terminology]: /getting-started/glossary/
[variables]: /getting-started/glossary/#variable
{{% /note %}}

View File

@ -1,16 +0,0 @@
---
title: Variables
linkTitle: Overview
description: Use these variables in your templates.
categories: []
keywords: []
menu:
docs:
identifier: variables-overview
parent: variables
weight: 10
weight: 10
aliases: [/templates/variables/]
---
{{% include "variables/_common/consistent-terminology.md" %}}

View File

@ -1,18 +0,0 @@
---
title: File variables
description: Retrieve file information about any page that is backed by a file.
categories: [variables]
keywords: []
menu:
docs:
parent: variables
weight: 20
weight: 20
aliases: [/variables/file-variables/,/variables/files/]
---
{{% include "variables/_common/consistent-terminology.md" %}}
To retrieve file information about any page that is backed by a file, see the documentation for the [`File`] method on a `Page` object.
[`File`]: /methods/page/file/

View File

@ -1,18 +0,0 @@
---
title: Git variables
description: Retrieve Git information related to the last commit of any page.
categories: [variables]
keywords: []
menu:
docs:
parent: variables
weight: 30
weight: 30
aliases: [/extras/gitinfo/]
---
{{% include "variables/_common/consistent-terminology.md" %}}
To retrieve Git information related to the last commit of any page, see the documentation for the [`GitInfo`] method on a `Page` object.
[`GitInfo`]: /methods/page/gitinfo/

View File

@ -1,16 +0,0 @@
---
title: Menu entry variables
description: Use these methods in your menu templates.
categories: [variables]
keywords: []
menu:
docs:
parent: variables
weight: 40
weight: 40
aliases: [/variables/menus/]
---
{{% include "variables/_common/consistent-terminology.md" %}}
{{< list-pages-in-section path=/methods/menu-entry titlePrefix=. >}}

View File

@ -1,63 +0,0 @@
---
title: Page variables
description: Use these methods with a Page object.
categories: [variables]
keywords: []
menu:
docs:
parent: variables
weight: 50
weight: 50
toc: true
---
{{% include "variables/_common/consistent-terminology.md" %}}
## All methods
Use any of these methods in your templates.
{{< list-pages-in-section path=/methods/page titlePrefix=. >}}
## Dates
Use these methods to access content dates.
{{< list-pages-in-section path=/methods/page filter=methods_page_dates filterType=include titlePrefix=. omitElementIDs=true >}}
## Multilingual
Use these methods with your multilingual projects.
{{< list-pages-in-section path=/methods/page filter=methods_page_multilingual filterType=include titlePrefix=. omitElementIDs=true >}}
## Navigation
Use these methods to create navigation links between pages.
{{< list-pages-in-section path=/methods/page filter=methods_page_navigation filterType=include titlePrefix=. omitElementIDs=true >}}
## Page collections
Range through these collections when rendering lists on [section] pages, [taxonomy] pages, [term] pages, and the home page.
[section]: /getting-started/glossary/#section
[taxonomy]: /getting-started/glossary/#taxonomy
[term]: /getting-started/glossary/#term
[context]: /getting-started/glossary/#context
{{< list-pages-in-section path=/methods/page filter=methods_page_page_collections filterType=include titlePrefix=. omitElementIDs=true >}}
## Parameters
Use these methods to access page parameters.
{{< list-pages-in-section path=/methods/page filter=methods_page_parameters filterType=include titlePrefix=. omitElementIDs=true >}}
## Sections
Use these methods to access section pages, and their ancestors and descendants. See&nbsp;[details].
[details]: /content-management/sections/
{{< list-pages-in-section path=/methods/page filter=methods_page_sections filterType=include titlePrefix=. omitElementIDs=true >}}

View File

@ -1,39 +0,0 @@
---
title: Pages variables
description: Use these methods with a collection of Page objects.
categories: [variables]
keywords: []
menu:
docs:
parent: variables
weight: 60
weight: 60
toc: true
aliases: [/variables/site-variables/]
---
{{% include "variables/_common/consistent-terminology.md" %}}
## All methods
Use any of these methods with page collections in your templates.
{{< list-pages-in-section path=/methods/pages titlePrefix=. >}}
## Sort by
Use these methods to sort page collections.
{{< list-pages-in-section path=/methods/pages filter=methods_pages_sort filterType=include titlePrefix=. omitElementIDs=true >}}
## Group by
Use these methods to group page collections.
{{< list-pages-in-section path=/methods/pages filter=methods_pages_group filterType=include titlePrefix=. omitElementIDs=true >}}
## Navigation
Use these methods to create navigation links between pages.
{{< list-pages-in-section path=/methods/pages filter=methods_pages_navigation filterType=include titlePrefix=. omitElementIDs=true >}}

View File

@ -1,16 +0,0 @@
---
title: Shortcode variables
description: Use these methods in your shortcode templates.
categories: [variables]
keywords: []
menu:
docs:
parent: variables
weight: 70
weight: 70
aliases: [/variables/shortcodes]
---
{{% include "variables/_common/consistent-terminology.md" %}}
{{< list-pages-in-section path=/methods/shortcode titlePrefix=. >}}

View File

@ -1,55 +0,0 @@
---
title: Site variables
description: Use these methods with Site objects. A multilingual project will have two or more sites, one for each language.
categories: [variables]
keywords: []
menu:
docs:
parent: variables
weight: 80
weight: 80
toc: true
aliases: [/variables/site-variables/]
---
{{% include "variables/_common/consistent-terminology.md" %}}
## All methods
Use any of these methods in your templates.
{{< list-pages-in-section path=/methods/site titlePrefix=.Site. >}}
## Multilingual
Use these methods with your multilingual projects.
{{< list-pages-in-section path=/methods/site filter=methods_site_multilingual filterType=include titlePrefix=.Site. omitElementIDs=true >}}
[`site`]: /functions/global/site/
[context]: /getting-started/glossary/#context
[configuration file]: /getting-started/configuration/
## Page collections
Range through these collections when rendering lists on any page.
{{< list-pages-in-section path=/methods/site filter=methods_site_page_collections filterType=include titlePrefix=.Site. omitElementIDs=true >}}
## Global site function
Within a partial template, if you did not pass a `Page` or `Site` object in [context], you cannot use this syntax:
```go-html-template
{{ .Site.SomeMethod }}
```
Instead, use the global [`site`] function:
```go-html-template
{{ site.SomeMethod }}
```
{{% note %}}
You can use the global site function in all templates to avoid context problems. Its usage is not limited to partial templates.
{{% /note %}}

View File

@ -1,21 +0,0 @@
---
title: Taxonomy variables
description: Use these methods with Taxonomy objects.
categories: [variables]
keywords: []
menu:
docs:
parent: variables
weight: 90
weight: 90
---
{{% include "variables/_common/consistent-terminology.md" %}}
{{< list-pages-in-section path=/methods/taxonomy titlePrefix=. >}}
{{% note %}}
Within a taxonomy or term template use the [`Data`] method to retrieve information specific to the taxonomy or term.
[`Data`]: /methods/page/data/
{{% /note %}}