github.com/rabbouni145/gg@v0.47.1/docs/content/en/functions/param.md (about)

     1  ---
     2  title: .Param
     3  description: Calls page or site variables into your template.
     4  godocref:
     5  date: 2017-02-01
     6  publishdate: 2017-02-01
     7  lastmod: 2017-04-30
     8  keywords: ["front matter"]
     9  categories: [functions]
    10  menu:
    11    docs:
    12      parent: "functions"
    13  toc:
    14  signature: [".Param KEY"]
    15  workson: []
    16  hugoversion:
    17  relatedfuncs: [default]
    18  deprecated: false
    19  draft: false
    20  aliases: []
    21  ---
    22  
    23  In Hugo, you can declare [site-wide params][sitevars] (i.e. in your [configuration][]), as well as params for [individual pages][pagevars].
    24  
    25  A common use case is to have a general value for the site and a more specific value for some of the pages (e.g., an image).
    26  
    27  You can use the `.Param` method to call these values into your template. The following will first look for an `image` param in a specific content's [front matter][]. If not found, Hugo will look for an `image` param in your site's configuration:
    28  
    29  ```
    30  $.Param "image"
    31  ```
    32  
    33  {{% note %}}
    34  The `Param` method may not consider empty strings in a content's front matter as "not found." If you are setting preconfigured front matter fields to empty strings using Hugo's archetypes, it may be best to use the [`default` function](/functions/default/) instead of `Param`. See the [related issue on GitHub](https://github.com/gohugoio/hugo/issues/3366).
    35  {{% /note %}}
    36  
    37  
    38  [configuration]: /getting-started/configuration/
    39  [front matter]: /content-management/front-matter/
    40  [pagevars]: /variables/page/
    41  [sitevars]: /variables/site/