Twitter Cards

With Twitter Cards, you can attach rich photos, videos and media experiences to Tweets, helping to drive traffic to your website.

Settings

You can set in config/_default/params.toml:

params.toml
# Hugo
title = "Hyas"
subTitle = "SEO"
description = "Congrats on setting up a new Doks project!"
images = ["cover.png"]

[social]
  twitter = "getdoks"

You can set in the frontmatter of a page:

---
title = "Example Guide"
description = "Guides lead a user through a specific task they want to accomplish, often with a sequence of steps."
date = 2024-03-08T08:18:11-08:00
images = ["post-cover.png"]
---

Generated meta tags

If images aren’t specified in the page front-matter, Hyas SEO searches for image page resources with feature, cover, or thumbnail in their name. If no image resources with those names are found, the images defined in config/_default/params.toml are used instead. If no images are found at all, then an image-less Twitter summary card is used instead of summary_large_image.

Hyas SEO uses the page title and description for the card’s title and description fields. The page summary is used if no description is given.

Hyas SEO generates the following meta tags — for example:

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://getdoks.org/cover.png">
<meta name="twitter:title" content="Welcome to Doks">
<meta name="twitter:description" content="Congrats on setting up a new Doks project!">
<meta name="twitter:site" content="@getdoks">

Resources