Skip to content

Commit

Permalink
Replace links to variable pages with links to method pages
Browse files Browse the repository at this point in the history
See #2196
  • Loading branch information
jmooring authored and bep committed Feb 19, 2024
1 parent ad4a124 commit b8d5383
Show file tree
Hide file tree
Showing 175 changed files with 382 additions and 378 deletions.
2 changes: 1 addition & 1 deletion content/en/about/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ toc: true
[install]: /installation/
[LiveReload]: /getting-started/usage/
[organization for your projects]: /getting-started/directory-structure/
[pagevars]: /variables/page/
[pagevars]: /methods/page/
[Permalink]: /content-management/urls/#permalinks
[Powerful theming]: /hugo-modules/theme-components/
[Pretty URLs]: /content-management/urls/
Expand Down
13 changes: 9 additions & 4 deletions content/en/content-management/archetypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,15 @@ You can use any [template function] within an archetype. As shown above, the def

Archetypes receive the following objects and values in [context]:

- `.Date`
- `.Type`
- `.Site` (see [details](/variables/site/))
- `.File` (see [details](/variables/file/))
- [`Date`]
- [`Type`]
- [`File`]
- [`Site`]

[`Date`]: /methods/page/date/
[`Type`]: /methods/page/type/
[`File`]: /methods/page/
[`Site`]: /methods/site/

As shown above, the default archetype passes `.File.ContentBaseName` as the argument to the `replace` function when populating the title in front matter.

Expand Down
16 changes: 8 additions & 8 deletions content/en/content-management/build-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ render
- `never`
: Never render the page to disk, and exclude it from all page collections.

[page bundles]: content-management/page-bundles
[page resources]: /content-management/page-resources
[`Permalink`]: /methods/resource/permalink
[`RelPermalink`]: /methods/resource/relpermalink
[`Publish`]: /methods/resource/publish
[page bundles]: /content-management/page-bundles/
[page resources]: /content-management/page-resources/
[`Permalink`]: /methods/resource/permalink/
[`RelPermalink`]: /methods/resource/relpermalink/
[`Publish`]: /methods/resource/publish/

{{% note %}}
Any page, regardless of its build options, will always be available by using the [`.Page.GetPage`] or [`.Site.GetPage`] method.

[`.Page.GetPage`]: /methods/page/getpage
[`.Site.GetPage`]: /methods/site/getpage
[`.Page.GetPage`]: /methods/page/getpage/
[`.Site.GetPage`]: /methods/site/getpage/
{{% /note %}}

## Example -- headless page
Expand Down Expand Up @@ -121,7 +121,7 @@ In the example above, note that:

Create a unpublished section whose content and resources can be included in other pages.

[branch bundle]: /content-management/page-bundles
[branch bundle]: /content-management/page-bundles/

```text
content/
Expand Down
2 changes: 1 addition & 1 deletion content/en/content-management/diagrams.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Will be rendered as:

Hugo does not provide a built-in template for Mermaid diagrams. Create your own using a [code block render hook]:

[code block render hook]: /render-hooks/code-blocks
[code block render hook]: /render-hooks/code-blocks/

{{< code file=layouts/_default/_markup/render-codeblock-mermaid.html >}}
<pre class="mermaid">
Expand Down
36 changes: 18 additions & 18 deletions content/en/content-management/front-matter.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The field names below are reserved. For example, you cannot create a custom fiel

(`map`) A map of [build options].

[build options]: /content-management/build-options
[build options]: /content-management/build-options/

###### cascade {#cascade-field}

Expand Down Expand Up @@ -115,16 +115,16 @@ If `true`, the page will not be rendered unless you pass the `--buildDrafts` fla

(`bool`) Set to `true` if the content language is in the [CJK] family. This value determines how Hugo calculates word count, and affects the values returned by the [`WordCount`], [`FuzzyWordCount`], and [`Summary`] methods on a `Page` object.

[`fuzzywordcount`]: /methods/page/wordcount
[`summary`]: /methods/page/wordcount
[`wordcount`]: /methods/page/wordcount
[`fuzzywordcount`]: /methods/page/wordcount/
[`summary`]: /methods/page/summary/
[`wordcount`]: /methods/page/wordcount/
[cjk]: /getting-started/glossary/#cjk

###### keywords

(`string array`) An array of keywords, typically rendered within a `meta` element within the `head` element of the published HTML file, or used as a [taxonomy] to classify content. Access these values from a template using the [`Keywords`] method on a `Page` object.

[`keywords`]: /methods/page/keywords
[`keywords`]: /methods/page/keywords/
[taxonomy]: /getting-started/glossary/#taxonomy

<!-- Added in v0.123.0 but purposefully omitted from documentation. -->
Expand All @@ -149,8 +149,8 @@ lang

(`string`) Provide a template name to [target a specific template], overriding the default [template lookup order]. Set the value to the base file name of the template, excluding its extension. Access this value from a template using the [`Layout`] method on a `Page` object.

[`layout`]: /methods/page/layout
[template lookup order]: /templates/lookup-order
[`layout`]: /methods/page/layout/
[template lookup order]: /templates/lookup-order/
[target a specific template]: templates/lookup-order/#target-a-template

###### linkTitle
Expand All @@ -172,7 +172,7 @@ Identifier|Content format
`pdc`|Pandoc
`rst`|reStructuredText

[content formats]: /content-management/formats
[content formats]: /content-management/formats/

###### menus

Expand All @@ -184,7 +184,7 @@ Identifier|Content format

(`string array`) The [output formats] to render.

[output formats]: /templates/output-formats
[output formats]: /templates/output-formats/

<!-- Added in v0.123.0 but purposefully omitted from documentation. -->
<!--
Expand All @@ -202,7 +202,7 @@ path

(`string`) The page publication date. Before the publication date, the page will not be rendered unless you pass the `--buildFuture` flag to the `hugo` command. Note that the TOML format also supports date/time values using unquoted strings. Access this value from a template using the [`PublishDate`] method on a `Page` object.

[`publishdate`]: /methods/page/publishdate
[`publishdate`]: /methods/page/publishdate/

###### resources

Expand All @@ -215,26 +215,26 @@ path
(`map`) A map of sitemap options. See the [sitemap templates] page for details. Access these values from a template using the [`Sitemap`] method on a `Page` object.

[sitemap templates]: /templates/sitemap-template/
[`sitemap`]: /methods/page/sitemap
[`sitemap`]: /methods/page/sitemap/

###### slug

(`string`) Overrides the last segment of the URL path. Not applicable to section pages. See the [URL management] page for details. Access this value from a template using the [`Slug`] method on a `Page` object.

[`slug`]: /methods/page/slug
[`slug`]: /methods/page/slug/
[URL management]: /content-management/urls/#slug

###### summary

(`string`) Conceptually different than the page `description`, the summary either summarizes the content or serves a teaser to encourage readers to visit the page. Access this value from a template using the [`Summary`] method on a `Page` object.

[`Summary`]: /methods/page/summary
[`Summary`]: /methods/page/summary/

###### title

(`string`) The page title. Access this value from a template using the [`Title`] method on a `Page` object.

[`title`]: /methods/page/title
[`title`]: /methods/page/title/

###### translationKey

Expand All @@ -247,7 +247,7 @@ path
(`string`) The [content type], overriding the value derived from the top level section in which the page resides. Access this value from a template using the [`Type`] method on a `Page` object.

[content type]: /getting-started/glossary/#content-type
[`type`]: /methods/page/type
[`type`]: /methods/page/type/

###### url

Expand All @@ -258,7 +258,7 @@ path

[page collection]: /getting-started/glossary/#page-collection
[weight]: /getting-started/glossary/#weight
[`weight`]: /methods/page/weight
[`weight`]: /methods/page/weight/

## Parameters

Expand All @@ -276,8 +276,8 @@ tags = ['red','blue']

Access these values from a template using the [`Params`] or [`Param`] method on a `Page` object.

[`param`]: /methods/page/param
[`params`]: /methods/page/params
[`param`]: /methods/page/param/
[`params`]: /methods/page/params/

## Cascade

Expand Down
6 changes: 3 additions & 3 deletions content/en/content-management/image-processing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,11 +500,11 @@ If you change image processing methods or options, or if you rename or remove im
hugo --gc
```

[time.Format]: /functions/time/format
[time.Format]: /functions/time/format/
[`anchor`]: /content-management/image-processing#anchor
[mounted]: /hugo-modules/configuration#module-configuration-mounts
[page bundle]: /content-management/page-bundles
[`lang.FormatNumber`]: /functions/lang/formatnumber
[page bundle]: /content-management/page-bundles/
[`lang.FormatNumber`]: /functions/lang/formatnumber/
[filters]: /functions/images/filter/#image-filters
[github.com/disintegration/imaging]: <https://github.com/disintegration/imaging#image-resizing>
[Smartcrop]: <https://github.com/muesli/smartcrop#smartcrop>
Expand Down
22 changes: 11 additions & 11 deletions content/en/content-management/multilingual.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ Private use subtags must not exceed 8 alphanumeric characters.

From within your templates, use the [`i18n`] function like this:

[`i18n`]: /functions/lang/translate
[`i18n`]: /functions/lang/translate/

```go-html-template
{{ i18n "home" }}
Expand Down Expand Up @@ -694,23 +694,23 @@ hugo new content content/en/post/test.md
hugo new content content/de/post/test.md
```

[`abslangurl`]: /functions/urls/abslangurl
[`abslangurl`]: /functions/urls/abslangurl/
[config]: /getting-started/configuration/
[contenttemplate]: /templates/single-page-templates/
[go-i18n-source]: https://github.com/nicksnyder/go-i18n
[go-i18n]: https://github.com/nicksnyder/go-i18n
[homepage]: /templates/homepage/
[Hugo Multilingual Part 1: Content translation]: https://regisphilibert.com/blog/2018/08/hugo-multilingual-part-1-managing-content-translation/
[i18func]: /functions/lang/translate
[lang.FormatAccounting]: /functions/lang/formataccounting
[lang.FormatCurrency]: /functions/lang/formatcurrency
[lang.FormatNumber]: /functions/lang/formatnumber
[lang.FormatNumberCustom]: /functions/lang/formatnumbercustom
[lang.FormatPercent]: /functions/lang/formatpercent
[i18func]: /functions/lang/translate/
[lang.FormatAccounting]: /functions/lang/formataccounting/
[lang.FormatCurrency]: /functions/lang/formatcurrency/
[lang.FormatNumber]: /functions/lang/formatnumber/
[lang.FormatNumberCustom]: /functions/lang/formatnumbercustom/
[lang.FormatPercent]: /functions/lang/formatpercent/
[lang.Merge]: /functions/lang/merge/
[menus]: /content-management/menus/
[OS environment]: /getting-started/configuration/#configure-with-environment-variables
[`rellangurl`]: /functions/urls/rellangurl
[RFC 5646]: https://tools.ietf.org/html/rfc5646
[`rellangurl`]: /functions/urls/rellangurl/
[RFC 5646]: https://tools.ietf.org/html/rfc564/
[single page templates]: /templates/single-page-templates/
[`time.Format`]: /functions/time/format
[`time.Format`]: /functions/time/format/
2 changes: 1 addition & 1 deletion content/en/content-management/organization/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ The `url` is the entire URL path, defined by the file path and optionally overri
[config]: /getting-started/configuration/
[formats]: /content-management/formats/
[front matter]: /content-management/front-matter/
[getpage]: /methods/page/getpage
[getpage]: /methods/page/getpage/
[homepage template]: /templates/homepage/
[homepage]: /templates/homepage/
[lists]: /templates/lists/
Expand Down
5 changes: 4 additions & 1 deletion content/en/content-management/sections.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ With the file structure from the [example above](#overview):

1. The articles/2022 and articles/2023 directories do not have list pages; they are not sections.

1. The list page for the products section, by default, includes product-1 and product-2, but not their descendant pages. To include descendant pages, use the `.RegularPagesRecursive` collection instead of the `.Pages` collection in the list template. See&nbsp;[details](/variables/page/#page-collections).
1. The list page for the products section, by default, includes product-1 and product-2, but not their descendant pages. To include descendant pages, use the `RegularPagesRecursive` method instead of the `Pages` method in the list template.

[`Pages`]: /methods/page/pages/
[`RegularPagesRecursive`]: /methods/page/regularpagesrecursive/

1. All directories in the products section have list pages; each directory is a section.

Expand Down
4 changes: 2 additions & 2 deletions content/en/content-management/shortcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,11 @@ To learn more about creating custom shortcodes, see the [shortcode template docu
[figureelement]: https://html5doctor.com/the-figure-figcaption-elements/
[Hugo and the GDPR]: /about/hugo-and-gdpr/
[Instagram]: https://www.instagram.com/
[pagevariables]: /variables/page/
[pagevariables]: /methods/page/
[partials]: /templates/partials/
[quickstart]: /getting-started/quick-start/
[sctemps]: /templates/shortcode-templates/
[scvars]: /variables/shortcode/
[scvars]: /methods/shortcode/
[shortcode template documentation]: /templates/shortcode-templates/
[templatessection]: /templates/
[Vimeo]: https://vimeo.com/
Expand Down
2 changes: 1 addition & 1 deletion content/en/content-management/summaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,5 @@ You can show content summaries with the following code. You could use the follow
Note how the `.Truncated` boolean variable value may be used to hide the "Read More..." link when the content is not truncated; i.e., when the summary contains the entire article.

[org]: /content-management/formats/
[pagevariables]: /variables/page/
[pagevariables]: /methods/page/
[section template]: /templates/section-templates/
2 changes: 1 addition & 1 deletion content/en/content-management/toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,6 @@ Hugo will take this AsciiDoc and create a table of contents store it in the page

[conditionals]: /templates/introduction/#conditionals
[front matter]: /content-management/front-matter/
[pagevars]: /variables/page/
[pagevars]: /methods/page/
[partials]: /templates/partials/
[single page template]: /templates/single-page-templates/
8 changes: 4 additions & 4 deletions content/en/contribute/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Other guidelines to consider:

Level 6 markdown headings are styled as `dt` elements. This was implemented to support a [glossary] with linkable terms.

[glossary]: /getting-started/glossary
[glossary]: /getting-started/glossary/

## Code examples

Expand Down Expand Up @@ -210,7 +210,7 @@ Use the “deprecated-in” shortcode to indicate that a feature is deprecated:
{{%/* deprecated-in 0.120.0 */%}}
Use [`hugo.IsServer`] instead.
[`hugo.IsServer`]: /functions/hugo/isserver
[`hugo.IsServer`]: /functions/hugo/isserver/
{{%/* /deprecated-in */%}}
```

Expand All @@ -219,7 +219,7 @@ Rendered:
{{% deprecated-in 0.120.0 %}}
Use [`hugo.IsServer`] instead.

[`hugo.IsServer`]: /functions/hugo/isserver
[`hugo.IsServer`]: /functions/hugo/isserver/
{{% /deprecated-in %}}

### code
Expand Down Expand Up @@ -298,7 +298,7 @@ Use the "deprecated-in" shortcode to indicate that a feature is deprecated:
{{%/* deprecated-in 0.120.0 */%}}
Use [`hugo.IsServer`] instead.

[`hugo.IsServer`]: /functions/hugo/isserver
[`hugo.IsServer`]: /functions/hugo/isserver/
{{%/* /deprecated-in */%}}
{{< /code >}}

Expand Down
4 changes: 2 additions & 2 deletions content/en/functions/collections/After.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ You can use `after` in combination with the [`first`] function and Hugo's [power
{{ end }}
{{< /code >}}

[`first`]: /functions/collections/first
[list/section page]: /templates/section-templates
[`first`]: /functions/collections/first/
[list/section page]: /templates/section-templates/
[lists]: /templates/lists/#sort-content
[`slice`]: /functions/collections/slice/
2 changes: 1 addition & 1 deletion content/en/functions/collections/Complement.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ To list everything except blog articles (`blog`) and frequently asked questions
{{% note %}}
Although the example above demonstrates the `complement` function, you could use the [`where`] function as well:

[`where`]: /functions/collections/where
[`where`]: /functions/collections/where/
{{% /note %}}

```go-html-template
Expand Down
2 changes: 1 addition & 1 deletion content/en/functions/collections/First.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ Use `first` and [`where`] together.
{{ end }}
```

[`where`]: /functions/collections/where
[`where`]: /functions/collections/where/
2 changes: 1 addition & 1 deletion content/en/functions/collections/KeyVals.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ aliases: [/functions/keyvals]

The primary application for this function is the definition of the `namedSlices` parameter in the options map passed to the [`Related`] method on the `Pages` object.

[`Related`]: /methods/pages/related
[`Related`]: /methods/pages/related/

See [related content](/content-management/related).

Expand Down
4 changes: 2 additions & 2 deletions content/en/functions/collections/NewScratch.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ action:

The `collections.NewScratch` function creates a locally scoped [scratch pad] to store and manipulate data. To create a scratch pad that is attached to a `Page` object, use the [`Scratch`] or [`Store`] method.

[`Scratch`]: /methods/page/scratch
[`Store`]: /methods/page/store
[`Scratch`]: /methods/page/scratch/
[`Store`]: /methods/page/store/
[scratch pad]: /getting-started/glossary/#scratch-pad

## Methods
Expand Down
2 changes: 1 addition & 1 deletion content/en/functions/collections/Sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ After sorting:
{{% note %}}
Although you can use the `sort` function to sort a page collection, Hugo provides [sorting and grouping methods] as well.

[sorting and grouping methods]: /methods/pages
[sorting and grouping methods]: /methods/pages/
{{% /note %}}

In this contrived example, sort the site's regular pages by `.Type` in descending order:
Expand Down
Loading

0 comments on commit b8d5383

Please sign in to comment.