Add first draft of content-management authors page

This commit is contained in:
Ryan Watters 2017-03-12 15:58:27 -05:00
parent b0eddb636d
commit 83fd79c4e1
30 changed files with 237 additions and 45 deletions

View File

@ -70,7 +70,7 @@ See what's coming next in the [Hugo roadmap][].
[install]: /getting-started/installing/
[LiveReload]: /getting-started/using-hugo/
[organization for your projects]: /getting-started/directory-structure/
[pagevars]: /variables/page-variables/
[pagevars]: /variables/page/
[Permalink]: /content-management/urls/#permalinks
[Powerful theming]: /themes/
[Pretty URLs]: /content-management/urls/

View File

@ -266,11 +266,11 @@ Themes section organization has only changed slightly in that the 6 content page
* Menus. This is broken into [/content-management/menus/](/content-management/menus/) and [/templates/menu-templates/](/templates/menu-templates/)
* Pagination. Now in [/templates/pagination/](/templates/pagination/)
* Permalinks. Now a heading/subsection of [/content-management/urls/](/content-management/urls/
* Scratch. Has it's own devoted function page at [/functions/scratch/](/functions/scratch/), and is therefore in the [Functions Quick Reference](/functions/). Also mentioned in an admonition in [/variables/page-variables/](/variables/page-variables/).
* Scratch. Has it's own devoted function page at [/functions/scratch/](/functions/scratch/), and is therefore in the [Functions Quick Reference](/functions/). Also mentioned in an admonition in [/variables/page/](/variables/page/).
* Shortcodes. Now split into two pages, one a [/content-management/shortcodes/](/content-management/shortcodes/) and the templating portion (i.e. "create your own shortcodes") at [/templates/shortcode-templates/]
* URLS. Now combined with permalinks and others as a heading/subsection of [/content-management/urls/](/content-management/urls/)
* Syntax Highlighting. The shortcode is featured and explained with usage examples at [/content-management/shortcodes/](/content-management/shortcodes/), as well as expaned upon in it's own page under [/tools/syntax-highlighting/](/tools/syntax-highlighting/). I did this under the assumption that *developers* are most interested in adding code blocks to their content.
* Table of Contents. This is now it's own page under [/content-management/toc](/content-management/toc/) and referenced in [/variables/page-variables](/variables/page-variables/).
* Table of Contents. This is now it's own page under [/content-management/toc](/content-management/toc/) and referenced in [/variables/page-variables](/variables/page/).
* Traversing Local Files. This is now split into [/templates/files/](/templates/files/) and variables delimited at [/variables/other/](/variables/other/).
### Community
@ -292,11 +292,12 @@ The "Community" section has been removed as a site navigation item because `/con
* Michael Henderson's "Creating a Theme" website ([current][],[concept][]) has been copy edited and content edited to include the new code block shortcodes. Michael did an *amazing* job with this tutorial, and it must have taken him *forever*, but much of the information included in the tutorial is now spread throughout the documentation in more appropriate places. Also, because this is an older tutorial, some of the paradigms aren't quite as up to date.
* Rick Cogley's still needs to be copy edited a bit, but overall looks good. That said, this tutorial was put together before Hugo began implementing it's international features.
* **Guidelines for New Tutorials**
* To keep the content in tutorials maintainable, it's important to set standards on what should be contained within said tutorials when published directly to the Hugo docs. (Of course, listing beginning-to-end tutorials in other areas of the website [i.e., press and articles] is a very good idea). The following pieces of information should be omitted from full-text tutorials in the Hugo docs because they are better delimited and kept current in other areas:
* Explanations directory structure or content organization
* Explanations of content formats (namely, `.md`) or front matter
* Explanations of how to set up hosting, deployments, or automated deployments (although these make excellent additions to the "Hosting and Deployments" section)
* "Using Hugo Shortcodes with Google Sheets or Data-Driven Content" is a better tutorial example than "Getting Up and Running with Hugo" or "Deploying Your Hugo Website with an Apache Server"
* **[[Update 2017-03-12]]** "Tutorials" as a site section has been completely removed. The remaining three articles: 1. Creating a Multilingual Site, 2. Creating a New Theme, and 3. Migrate from Jekyll to Hugo were a) duplicative, b) outdated, or c) contradictory (specifically w/r/t Hugo-specific terms). Full-length tutorials can be a very difficult thing to maintain within documentation; it's my position that it's better to provide examples and explanations throughout the documentation and then allow the community to publish their own tutorials (i.e., with links to the tutorials on the Articles Page).
* ~~To keep the content in tutorials maintainable, it's important to set standards on what should be contained within said tutorials when published directly to the Hugo docs. (Of course, listing beginning-to-end tutorials in other areas of the website [i.e., press and articles] is a very good idea). The following pieces of information should be omitted from full-text tutorials in the Hugo docs because they are better delimited and kept current in other areas:~~
* ~~Explanations directory structure or content organization~~
* ~~Explanations of content formats (namely, `.md`) or front matter~~
* ~~Explanations of how to set up hosting, deployments, or automated deployments (although these make excellent additions to the "Hosting and Deployments" section)~~
* ~~"Using Hugo Shortcodes with Google Sheets or Data-Driven Content" is a better tutorial example than "Getting Up and Running with Hugo" or "Deploying Your Hugo Website with an Apache Server"~~
### Troubleshooting
@ -358,6 +359,7 @@ Apache License - 60
* Front Matter - 30
* Shortcodes - 40
* Sections - 50
* Authors - 55 (in draft status)
* Content Types - 60
* Archetypes - 70
* Taxonomies - 80

View File

@ -0,0 +1,189 @@
---
title: Authors
linktitle: Authors
description:
date: 2016-08-22
publishdate: 2017-03-12
lastmod: 2017-03-12
tags: [authors]
categories: ["content management"]
weight: 55
draft: true
aliases: [/content/archetypes/]
toc: true
---
<!-- Before this page is published, need to also update both site- and page-level variables documentation. -->
Larger sites often have multiple content authors. Hugo provides standardized author profiles to organize relationships between content and content creators for sites operating under a distributed authorship model.
## Author Profiles
You can create a profile containing metadata for each author on your website. These profiles have to be saved under `data/_authors/`. The filename of the profile will later be used as an identifier. This way Hugo can associate content with one or multiple authors. An author's profile can be defined in the JSON, YAML, or TOML format.
### Example: Author Profile
Let's suppose Alice Allison is a blogger. A simple unique identifier would be `alice`. Now, we have to create a file called `alice.toml` in the `data/_authors/` directory. The following example is the standardized template written in TOML:
{{% code file="data/_authors/alice.toml" %}}
```toml
givenName = "Alice" # or firstName as alias
familyName = "Allison" # or lastName as alias
displayName = "Alice Allison"
thumbnail = "static/authors/alice-thumb.jpg"
image = "static/authors/alice-full.jpg"
shortBio = "My name is Alice and I'm a blogger."
bio = "My name is Alice and I'm a blogger... some other stuff"
email = "alice.allison@email.com"
weight = 10
[social]
facebook = "alice.allison"
twitter = "alice"
googleplus = "aliceallison1"
website = "www.example.com"
[params]
random = "whatever you want"
```
{{% /code %}}
All variables are optional but it's advised to fill all important ones (e.g. names and biography) because themes can vary in their usage.
You can store files for the `thumbnail` and `image` attributes in the `static` folder. Then add the path to the photos relative to `static`; e.g., `/static/path/to/thumbnail.jpg`.
`weight` allows you to define the order of an author in an `.Authors` list and can be accessed on list or via the `.Site.Authors` variable.
The `social` section contains all the links to the social network accounts of an author. Hugo is able to generate the account links for the most popular social networks automatically. This way, you only have to enter your username. You can find a list of all supported social networks [here](#linking-social-network-accounts-automatically). All other variables, like `website` in the example above remain untouched.
The `params` section can contain arbitrary data much like the same-named section in the config file. What it contains is up to you.
## Associating Content Through Identifiers
Earlier it was mentioned that content can be associated with an author through their corresponding identifier. In our case, blogger Alice has the identifier `alice`. In the front matter of a content file, you can create a list of identifiers and assign it to the `authors` variable. Here are examples for `alice` using YAML and TOML, respectively.
```yaml
---
title: Why Hugo is so Awesome
date: 2016-08-22T14:27:502:00
authors: ["alice"]
---
Nothing to read here. Move along...
```
```toml
+++
title = Why Hugo is so Awesome
date = "2016-08-22T14:27:502:00"
authors: ["alice"]
+++
Nothing to read here. Move along...
```
Future authors who might work on this blog post can append their identifiers to the `authors` array in the front matter as well.
## Working with Templates
After a successful setup it's time to give some credit to the authors by showing them on the website. Within the templates Hugo provides a list of the author's profiles if they are listed in the `authors` variable within the front matter.
The list is accessible via the `.Authors` template variable. Printing all authors of a the blog post is straight forward:
```
{{ range .Authors }}
{{ .DisplayName }}
{{ end }}
# output: Alice Allison
```
Even if there are co-authors you may only want to show the main author. For this case you can use the `.Author` template variable **(note the singular form)**. The template variable contains the profile of the author that is first listed with his identifier in the front matter.
{{% note %}}
You can find a list of all template variables to access the profile information in [Author Variables](/variables/authors/).
{{% /note %}}
### Linking Social Network Accounts
As aforementioned, Hugo is able to generate links to profiles of the most popular social networks. The following social networks with their corrersponding identifiers are supported: `github`, `facebook`, `twitter`, `googleplus`, `pinterest`, `instagram`, `youtube` and `linkedin`.
This is can be done with the `.Social.URL` function. Its only parameter is the name of the social network as they are defined in the profile (e.g. `facebook`, `googleplus`). Custom variables like `website` remain as they are.
Most articles feature a small section with information about the author at the end. Let's create one containing the author's name, a thumbnail, a (summarized) biography and links to all social networks:
{{% code file="layouts/partials/author-info.html" download="author-info.html" %}}
```html
{{ with .Author }}
<h3>{{ .DisplayName }}</h3>
<img src="{{ .Thumbnail | absURL }}" alt="{{ .DisplayName }}">
<p>{{ .ShortBio }}</p>
<ul>
{{ range $network, $username := .Social }}
<li><a href="{{ $.Author.Social.URL $network }}">{{ $network }}</a></li>
{{ end }}
</ul>
{{ end }}
```
{{% /code %}}
## Who Published What?
That question can be answered with a list of all authors and another list containing all articles that they each have written. Now we have to translate this idea into templates. The [taxonomy][] feature allows us to logically group content based on information that they have in common; e.g. a tag or a category. Well, many articles share the same author, so this should sound familiar, right?
In order to let Hugo know that we want to group content based on their author, we have to create a new taxonomy called `author` (the name corresponds to the variable in the front matter). Here is the snippet in a `config.yaml` and `config.toml`, respectively:
```yaml
taxonomies:
author: authors
```
```toml
[taxonomies]
author = "authors"
```
### Listing All Authors
In the next step we can create a template to list all authors of your website. Later, the list can be accessed at `www.example.com/authors/`. Create a new template in the `layouts/taxonomy/` directory called `authors.term.html`. This template will be exclusively used for this taxonomy.
{{% code file="layouts/taxonomy/author.term.html" download="author.term.html" %}}
```html
<ul>
{{ range $author, $v := .Data.Terms }}
{{ $profile := $.Authors.Get $author }}
<li>
<a href="{{ printf "%s/%s/" $.Data.Plural $author | absURL }}">
{{ $profile.DisplayName }} - {{ $profile.ShortBio }}
</a>
</li>
{{ end }}
</ul>
```
{{% /code %}}
`.Data.Terms` contains the identifiers of all authors and we can range over it to create a list with all author names. The `$profile` variable gives us access to the profile of the current author. This allows you to generate a nice info box with a thumbnail, a biography and social media links, like at the [end of a blog post](#linking-social-network-accounts-automatically).
### Listing Each Author's Publications
Last but not least, we have to create the second list that contains all publications of an author. Each list will be shown in its own page and can be accessed at `www.example.com/authors/<IDENTIFIER>`. Replace `<IDENTIFIER>` with a valid author identifier like `alice`.
The layout for this page can be defined in the template `layouts/taxonomy/author.html`.
{{% code file="layouts/taxonomy/author.html" download="author.html" %}}
```html
{{ range .Data.Pages }}
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<span>written by {{ .Author.DisplayName }}</span>
{{ .Summary }}
{{ end }}
```
{{% /code %}}
The example above generates a simple list of all posts written by a single author. Inside the loop you've access to the complete set of [page variables][pagevars]. Therefore, you can add additional information about the current posts like the publishing date or the tags.
With a lot of content this list can quickly become very long. Consider to use the [pagination][] feature. It splits the list into smaller chunks and spreads them over multiple pages.
[pagevars]: /variables/page/
[pagination]: /templates/pagination/

View File

@ -402,7 +402,7 @@ To learn more about creating your own shortcode templates, see the [shortcode te
[figureelement]: http://html5doctor.com/the-figure-figcaption-elements/ "An article from HTML5 doctor discussing the fig and figcaption elements."
[`figure` shortcode]: #figure
[Instagram]: https://www.instagram.com/
[pagevariables]: /variables/page-variables/
[pagevariables]: /variables/page/
[partials]: /templates/partials-templates/
[Pygments]: http://pygments.org/
[quickstart]: /getting-started/quick-start/

View File

@ -71,5 +71,5 @@ You can show content summaries with the following code. You could use the follow
Note how the `.Truncated` boolean valuable 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-variables/
[pagevariables]: /variables/page/
[section template]: /templates/section-templates/

View File

@ -16,7 +16,7 @@ toc: false
Hugo can automatically parse Markdown content and create a Table of Contents you can leverage in your templates to guide readers to sections of longer pages.
{{% note "TOC Heading Levels are Fixed" %}}
Currently, the {{.TableOfContents}} [page variable](/variables/page-variables/) is fixed in its behavior; i.e., you do not have the option to set the heading level at which the TOC renders. This is a [known issue (#1778)](https://github.com/spf13/hugo/issues/1778).
Currently, the {{.TableOfContents}} [page variable](/variables/page/) is fixed in its behavior; i.e., you do not have the option to set the heading level at which the TOC renders. This is a [known issue (#1778)](https://github.com/spf13/hugo/issues/1778).
{{% /note %}}
## Usage
@ -60,6 +60,6 @@ The following is an example of very basic [single page template][]:
{{% /code %}}
[pagevars]: /variables/page-variables/
[pagevars]: /variables/page/
[partials]: /templates/partials/
[single page template]: /templates/single-page-template/

View File

@ -23,4 +23,4 @@ In contrast with `countwords` function, which counts every word in a string, the
<!-- outputs a content length of 8 runes. -->
```
[pagevars]: /variables/page-variables/
[pagevars]: /variables/page/

View File

@ -24,4 +24,4 @@ aliases: [/functions/countrunes/,/functions/countwords/]
```
[pagevars]: /variables/page-variables/
[pagevars]: /variables/page/

View File

@ -120,5 +120,5 @@ In conjunction with the [`dateFormat` function][dateFormat], you can also conver
[CST]: https://en.wikipedia.org/wiki/Central_Time_Zone
[dateFormat]: /functions/dateformat/
[gdex]: https://golang.org/pkg/time/#example_Time_Format
[pagevars]: /variables/page-variables/
[pagevars]: /variables/page/
[time]: https://golang.org/pkg/time/

View File

@ -24,4 +24,4 @@ aliases: []
See also the `.PlainWords`, `.Plain`, and `.RawContent` [page variables][pagevars].
[pagevars]: /variables/page-variables/
[pagevars]: /variables/page/

View File

@ -30,5 +30,5 @@ $.Param "image"
```
[configuration]: /getting-started/configuration/
[pagevars]: /variables/page-variables/
[sitevars]: /variables/site-variables/
[pagevars]: /variables/page/
[sitevars]: /variables/site/

View File

@ -25,6 +25,6 @@ aliases: []
See also the [`.PlainWords`, `.Plain`, and `.RawContent` page variables][pagevars].
[pagevars]: /variables/page-variables/
[pagevars]: /variables/page/

View File

@ -68,4 +68,4 @@ The usage is best illustrated with some samples:
**Note:** The examples above uses the special `$` variable, which refers to the top-level node. This is the behavior you most likely want, and will help remove some confusion when using `Scratch` inside page range loops -- and you start inadvertently calling the wrong `Scratch`. But there may be use cases for `{{ .Scratch.Add "key" "some value" }}`.
[pagevars]: /variables/page-variables/
[pagevars]: /variables/page/

View File

@ -20,5 +20,5 @@ aliases: []
`{{ "cats" | singularize }}` → "cat"
See also the `.Data.Singular` [taxonomy variable](/variables/taxonomy-variables/) for singularizing taxonomy names.
See also the `.Data.Singular` [taxonomy variable](/variables/taxonomy/) for singularizing taxonomy names.

View File

@ -105,7 +105,7 @@ This directory structure tells us a lot about this website:
## Content for Homepage and Other List Pages
Since Hugo 0.18, "everything" is a `Page` that can have content and metadata, like `.Params`, attached to it -- and share the same set of [page variables](/variables/page-variables/).
Since Hugo 0.18, "everything" is a `Page` that can have content and metadata, like `.Params`, attached to it -- and share the same set of [page variables](/variables/page/).
To add content and front matter to the home page, a section, a taxonomy or a taxonomy terms listing, add a markdown file with the base name `_index` on the relevant place on the file system.

View File

@ -83,5 +83,5 @@ In conjunction with the [`dateFormat` function][dateFormat], you can also conver
[CST]: https://en.wikipedia.org/wiki/Central_Time_Zone
[dateFormat]: /functions/dateformat/
[gdex]: https://golang.org/pkg/time/#example_Time_Format
[pagevars]: /variables/page-variables/
[pagevars]: /variables/page/
[time]: https://golang.org/pkg/time/

View File

@ -54,4 +54,4 @@ Your 404.html file can be set to load automatically when a visitor enters a mist
* _Amazon AWS S3_ - when setting a bucket up for static web serving, you can specify the error file.
* _Caddy Server_ - using `errors { 404 /404.html }`. [Details here](https://caddyserver.com/docs/errors)
[pagevars]: /variables/page-variables/
[pagevars]: /variables/page/

View File

@ -101,7 +101,7 @@ And here is the result as [called directly in the Hugo docs][] and rendered for
{{< readfile file="content/readfiles/testing.txt" markdown="true">}}
[called directly in the Hugo docs]: https://github.com/spf13/hugo/blob/master/docs/content/templates/local-file-templates.md
[called directly in the Hugo docs]: https://github.com/spf13/hugo/blob/master/docs/content/templates/files.md
[dirindex]: https://github.com/spf13/hugo/blob/master/docs/layouts/shortcodes/directoryindex.html
[osfileinfo]: https://golang.org/pkg/os/#FileInfo
[reads]: /functions/readfile/

View File

@ -66,6 +66,6 @@ The following is an example of a homepage template that uses [partial][partials]
[contentorg]: /content-management/organization/
[lists]: /templates/lists/
[lookup]: /templates/lookup-order/
[pagevars]: /variables/page-variables/
[pagevars]: /variables/page/
[partials]: /templates/partials/
[sitevars]: /variables/site-variables/
[sitevars]: /variables/site/

View File

@ -477,9 +477,9 @@ Go allows you to do more than what's shown here. Using Hugo's [`where` function]
[index]: /functions/index/
[math functions]: /functions/math/
[partials]: /templates/partials-templates/ "Link to the partial templates page inside of the templating section of the Hugo docs"
[relpermalink]: /variables/page-variables/
[relpermalink]: /variables/page/
[safehtml]: /functions/safehtml/
[sitevars]: /variables/site-variables/
[sitevars]: /variables/site/
[variables]: /variables/ "See the full extent of page-, site-, and other variables that Hugo make available to you in your templates."
[where]: /functions/where/
[with]: /functions/with/

View File

@ -82,7 +82,7 @@ If `where` or `first` receives invalid input or a field name that doesnt exis
[rss]: /templates/rss/
[sections]: /content-management/sections/
[sectiontemps]: /templates/section-templates
[sitevars]: /variables/site-variables/
[sitevars]: /variables/site/
[taxlists]: /templates/taxonomy-templates/#taxonomy-list-templates/
[taxvars]: /templates/taxonomy-variables/
[taxterms]: /templates/taxonomy-templates/#taxonomy-terms-templates/

View File

@ -259,7 +259,7 @@ More shortcode examples can be found in the [shortcodes directory for spf13.com]
[source organization]: /getting-started/directory-structure/ "Learn how Hugo scaffolds new sites and what it expects to find in each of your directories."
[docsshortcodes]: https://github.com/spf13/hugo/tree/master/docs/layouts/shortcodes "See the shortcode source directory for the documentation site you're currently reading."
[figure]: /content-management/shortcodes/#figure
[pagevars]: /variables/page-variables/ "See which variables you can leverage in your templating for page vs list templates."
[pagevars]: /variables/page/ "See which variables you can leverage in your templating for page vs list templates."
[shortcodesvars]: /variables/shortcode-variables/ "Certain variables are specific to shortcodes, although most .Page variables can be accessed within your shortcode template."
[spf13shortcodes]: https://github.com/spf13/spf13.com/tree/master/layouts/shortcodes "See more examples of shortcodes by visiting the shortcode directory of the source for spf13.com, the blog of Hugo's creator, Steve Francia."
[templates]: /templates/ "The templates section of the Hugo docs."

View File

@ -147,8 +147,8 @@ To easily generate new instances of this content type (e.g., new `.md` files in
[directory structure]: /getting-started/directory-structure/
[dry]: https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
[front matter]: /content-management/front-matter/
[page variables]: /variables/page-variables/
[page variables]: /variables/page/
[partials]: /templates/partials/
[section]: /content-management/sections/
[site variables]: /variables/site-variables/
[site variables]: /variables/site/
[spf13]: http://spf13.com/

View File

@ -68,4 +68,4 @@ Defaults for `<changefreq>`, `<priority>` and `filename` values can be set in th
The same fields can be specified in an individual content file's front matter in order to override the value assigned to that piece of content at render time.
[pagevars]: /variables/page-variables/
[pagevars]: /variables/page/

View File

@ -312,4 +312,4 @@ This example will list all taxonomies and their terms, as well as all the conten
[delimit]: /functions/delimit/
[renderlists]: /templates/lists/
[single page template]: /templates/single-page-templates/
[sitevars]: /variables/site-variables/
[sitevars]: /variables/site/

View File

@ -111,7 +111,7 @@ Continuing on the previous example, we can change our render function to use a s
[lists]: /templates/lists/
[lookup]: /templates/lookup-order/
[pagevars]: /variables/page-variables/
[pagevars]: /variables/page/
[render]: /functions/render/
[single]: /templates/single-page-templates/
[spf]: http://spf13.com

View File

@ -8,7 +8,7 @@ lastmod: 2017-03-12
tags: [performance, build]
categories: [troubleshooting]
weight:
draft: false
draft: true
slug:
aliases: []
toc: true

View File

@ -9,14 +9,14 @@ categories: [variables and params]
tags: [pages]
draft: false
weight: 20
aliases: []
aliases: [/variables/page/]
toc: true
---
The following is a list of page-level variables that can be defined for a piece of content. Many of these will be defined in the front matter, derived from file location, or extracted from the content itself.
{{% note "`.Scratch`" %}}
See [`.Scratch`](/functions/scratch/) for page-scoped writable variables.
See [`.Scratch`](/functions/scratch/) for page-scoped, writable variables.
{{% /note %}}
## Page Variables List
@ -127,7 +127,7 @@ http://remarkjs.com)
: the [section](/content-management/sections/) this content belongs to.
`.Site`
: see [Site Variables](/variables/site-variables/).
: see [Site Variables](/variables/site/).
`.Summary`
: a generated summary of the content for easily showing a snippet in a summary view. The breakpoint can be set manually by inserting <code>&lt;!&#x2d;&#x2d;more&#x2d;&#x2d;&gt;</code> at the appropriate place in the content page. See [Content Summaries](/content-management/summaries/) for more details.

View File

@ -9,12 +9,11 @@ categories: [variables and params]
tags: [global,site]
draft: false
weight: 10
aliases: []
aliases: [/variables/site-variables/]
toc: true
notesforauthors:
---
The following is a list of site-level variables (aka "global"). Many of these variables are defined in your site's [configuration file](/getting-started/config/), whereas others are built into Hugo's core for convenient usage in your templates.
The following is a list of site-level (aka "global") variables. Many of these variables are defined in your site's [configuration file][config], whereas others are built into Hugo's core for convenient usage in your templates.
## Site Variables List
@ -100,7 +99,7 @@ The following is a list of site-level variables (aka "global"). Many of these va
`.Site.Params` is a container holding the values from the `params` section of your site configuration.
### `.Site.Params` Example
### Example: `.Site.Params`
The following `config.toml` defines a site-wide param for `description`:
@ -118,4 +117,6 @@ You can use `.Site.Params` in a [partial template](/templates/partials/) to call
```html
<meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}" />
```
{{% /code %}}
{{% /code %}}
[config]: /getting-started/configuration/