From 9f9a9315f8737b804c6926d226b3924e6104d931 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Sat, 3 Feb 2024 15:07:29 -0800 Subject: [PATCH] Remove variables section See #2196 --- config/_default/menus/menus.en.toml | 22 +++---- content/en/methods/_index.md | 1 + content/en/variables/_common/_index.md | 13 ---- .../_common/consistent-terminology.md | 20 ------ content/en/variables/_index.md | 16 ----- content/en/variables/file.md | 18 ------ content/en/variables/git.md | 18 ------ content/en/variables/menu-entry.md | 16 ----- content/en/variables/page.md | 63 ------------------- content/en/variables/pages.md | 39 ------------ content/en/variables/shortcode.md | 16 ----- content/en/variables/site.md | 55 ---------------- content/en/variables/taxonomy.md | 21 ------- 13 files changed, 9 insertions(+), 309 deletions(-) delete mode 100644 content/en/variables/_common/_index.md delete mode 100644 content/en/variables/_common/consistent-terminology.md delete mode 100644 content/en/variables/_index.md delete mode 100644 content/en/variables/file.md delete mode 100644 content/en/variables/git.md delete mode 100644 content/en/variables/menu-entry.md delete mode 100644 content/en/variables/page.md delete mode 100644 content/en/variables/pages.md delete mode 100644 content/en/variables/shortcode.md delete mode 100644 content/en/variables/site.md delete mode 100644 content/en/variables/taxonomy.md diff --git a/config/_default/menus/menus.en.toml b/config/_default/menus/menus.en.toml index e6d95589ab..7c7b59f524 100644 --- a/config/_default/menus/menus.en.toml +++ b/config/_default/menus/menus.en.toml @@ -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/' diff --git a/content/en/methods/_index.md b/content/en/methods/_index.md index c12bd9d4d4..d014b55255 100644 --- a/content/en/methods/_index.md +++ b/content/en/methods/_index.md @@ -11,6 +11,7 @@ menu: weight: 10 weight: 10 showSectionMenu: true +aliases: ['/variables/'] --- Use these methods within your templates. diff --git a/content/en/variables/_common/_index.md b/content/en/variables/_common/_index.md deleted file mode 100644 index 47d5812fba..0000000000 --- a/content/en/variables/_common/_index.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -cascade: - _build: - list: never - publishResources: false - render: never ---- - - diff --git a/content/en/variables/_common/consistent-terminology.md b/content/en/variables/_common/consistent-terminology.md deleted file mode 100644 index 5b67ab4b46..0000000000 --- a/content/en/variables/_common/consistent-terminology.md +++ /dev/null @@ -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 %}} diff --git a/content/en/variables/_index.md b/content/en/variables/_index.md deleted file mode 100644 index d8dbf9d676..0000000000 --- a/content/en/variables/_index.md +++ /dev/null @@ -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" %}} diff --git a/content/en/variables/file.md b/content/en/variables/file.md deleted file mode 100644 index 157932a2d7..0000000000 --- a/content/en/variables/file.md +++ /dev/null @@ -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/ diff --git a/content/en/variables/git.md b/content/en/variables/git.md deleted file mode 100644 index f722faf007..0000000000 --- a/content/en/variables/git.md +++ /dev/null @@ -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/ diff --git a/content/en/variables/menu-entry.md b/content/en/variables/menu-entry.md deleted file mode 100644 index 5b90dab6f1..0000000000 --- a/content/en/variables/menu-entry.md +++ /dev/null @@ -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=. >}} diff --git a/content/en/variables/page.md b/content/en/variables/page.md deleted file mode 100644 index 732cf54993..0000000000 --- a/content/en/variables/page.md +++ /dev/null @@ -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 [details]. - -[details]: /content-management/sections/ - -{{< list-pages-in-section path=/methods/page filter=methods_page_sections filterType=include titlePrefix=. omitElementIDs=true >}} diff --git a/content/en/variables/pages.md b/content/en/variables/pages.md deleted file mode 100644 index 24b8fbbf44..0000000000 --- a/content/en/variables/pages.md +++ /dev/null @@ -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 >}} diff --git a/content/en/variables/shortcode.md b/content/en/variables/shortcode.md deleted file mode 100644 index 57279b5dec..0000000000 --- a/content/en/variables/shortcode.md +++ /dev/null @@ -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=. >}} diff --git a/content/en/variables/site.md b/content/en/variables/site.md deleted file mode 100644 index 56116d2617..0000000000 --- a/content/en/variables/site.md +++ /dev/null @@ -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 %}} diff --git a/content/en/variables/taxonomy.md b/content/en/variables/taxonomy.md deleted file mode 100644 index 0927183a4f..0000000000 --- a/content/en/variables/taxonomy.md +++ /dev/null @@ -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 %}}