docs: document configure opengraph image (#706)

* [Docs] document using og:image

* Make example title page match others

* clarify wording
This commit is contained in:
Matt Dodson
2025-06-10 19:45:19 -03:00
committed by GitHub
parent b1d40c4a2d
commit 7385fe9e2a

View File

@ -319,3 +319,18 @@ To exclude an entire directory, use the [`cascade`](https://gohugo.io/configurat
> To block search crawlers, you can make a [`robots.txt` template](https://gohugo.io/templates/robots/).
> However, `robots.txt` instructions do not necessarily keep a page out of Google search results.
### Open Graph
To add [Open Graph](https://ogp.me/) metadata to a page, add values in the frontmatter params.
As a page can have multiple `image` and `video` tags, place their values in an array.
Other Open Graph properties can have only one value.
For example, this page has an `og:image` tag (which configures an image to preview on social shares) and an `og:audio` tag.
```yaml {filename="content/docs/guide/configuration.md"}
title: "Configuration"
params:
images:
- "/img/config-image.jpg"
audio: "config-talk.mp3"
```