aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/content/en/variables
diff options
context:
space:
mode:
Diffstat (limited to 'docs/content/en/variables')
-rw-r--r--docs/content/en/variables/_common/_index.md13
-rw-r--r--docs/content/en/variables/_common/consistent-terminology.md20
-rw-r--r--docs/content/en/variables/_index.md16
-rw-r--r--docs/content/en/variables/file.md18
-rw-r--r--docs/content/en/variables/git.md18
-rw-r--r--docs/content/en/variables/menu-entry.md16
-rw-r--r--docs/content/en/variables/page.md63
-rw-r--r--docs/content/en/variables/pages.md39
-rw-r--r--docs/content/en/variables/shortcode.md16
-rw-r--r--docs/content/en/variables/site.md55
-rw-r--r--docs/content/en/variables/taxonomy.md21
11 files changed, 295 insertions, 0 deletions
diff --git a/docs/content/en/variables/_common/_index.md b/docs/content/en/variables/_common/_index.md
new file mode 100644
index 000000000..47d5812fb
--- /dev/null
+++ b/docs/content/en/variables/_common/_index.md
@@ -0,0 +1,13 @@
+---
+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.
+-->
diff --git a/docs/content/en/variables/_common/consistent-terminology.md b/docs/content/en/variables/_common/consistent-terminology.md
new file mode 100644
index 000000000..8774c817b
--- /dev/null
+++ b/docs/content/en/variables/_common/consistent-terminology.md
@@ -0,0 +1,20 @@
+---
+# 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 %}}
diff --git a/docs/content/en/variables/_index.md b/docs/content/en/variables/_index.md
new file mode 100644
index 000000000..d8dbf9d67
--- /dev/null
+++ b/docs/content/en/variables/_index.md
@@ -0,0 +1,16 @@
+---
+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" %}}
diff --git a/docs/content/en/variables/file.md b/docs/content/en/variables/file.md
new file mode 100644
index 000000000..248d84991
--- /dev/null
+++ b/docs/content/en/variables/file.md
@@ -0,0 +1,18 @@
+---
+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
diff --git a/docs/content/en/variables/git.md b/docs/content/en/variables/git.md
new file mode 100644
index 000000000..3dc473265
--- /dev/null
+++ b/docs/content/en/variables/git.md
@@ -0,0 +1,18 @@
+---
+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
diff --git a/docs/content/en/variables/menu-entry.md b/docs/content/en/variables/menu-entry.md
new file mode 100644
index 000000000..5b90dab6f
--- /dev/null
+++ b/docs/content/en/variables/menu-entry.md
@@ -0,0 +1,16 @@
+---
+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=. >}}
diff --git a/docs/content/en/variables/page.md b/docs/content/en/variables/page.md
new file mode 100644
index 000000000..732cf5499
--- /dev/null
+++ b/docs/content/en/variables/page.md
@@ -0,0 +1,63 @@
+---
+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 >}}
diff --git a/docs/content/en/variables/pages.md b/docs/content/en/variables/pages.md
new file mode 100644
index 000000000..24b8fbbf4
--- /dev/null
+++ b/docs/content/en/variables/pages.md
@@ -0,0 +1,39 @@
+---
+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 >}}
diff --git a/docs/content/en/variables/shortcode.md b/docs/content/en/variables/shortcode.md
new file mode 100644
index 000000000..57279b5de
--- /dev/null
+++ b/docs/content/en/variables/shortcode.md
@@ -0,0 +1,16 @@
+---
+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=. >}}
diff --git a/docs/content/en/variables/site.md b/docs/content/en/variables/site.md
new file mode 100644
index 000000000..532357785
--- /dev/null
+++ b/docs/content/en/variables/site.md
@@ -0,0 +1,55 @@
+---
+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 %}}
diff --git a/docs/content/en/variables/taxonomy.md b/docs/content/en/variables/taxonomy.md
new file mode 100644
index 000000000..ee6d73b2e
--- /dev/null
+++ b/docs/content/en/variables/taxonomy.md
@@ -0,0 +1,21 @@
+---
+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 %}}