Skip to content
DataLeaf

Documentation

Metadata and social previews

DataLeaf emits canonical URLs, standard descriptions, Open Graph metadata, X/Twitter Card metadata, and JSON-LD structured data.

Description fallbacks

#

For pages, DataLeaf uses this order:

  1. page front matter description;
  2. the generated page summary;
  3. site-level params.description.

For list and home pages, the site description is the normal fallback.

Example:

yaml
---
title: "Calibration under dataset shift"
description: "A practical note on probability calibration when deployment data drift."
---

Canonical URLs

#

Every rendered page receives:

html
<link rel="canonical" href="https://example.org/the/page/">

The URL follows Hugo’s permalink and base URL. Paginated home and list pages use their own page URL (for example, /page/2/) for both canonical and Open Graph URLs.

Social metadata

#

DataLeaf uses Hugo’s embedded Open Graph and X/Twitter Card templates.

Site-level fallback image:

toml
[params]
  images = ["images/social-card.png"]

Page-level override:

yaml
---
images:
  - images/post-cover.png
---

If you use X/Twitter and want the site account attached to cards:

toml
[params.social]
  twitter = "your_handle"

Structured data

#

The home page emits a WebSite JSON-LD object.

Regular content pages emit an Article object containing available publication/modification dates, section, tags, canonical URL, description, language, and configured author metadata.

Author configuration:

toml
[params.author]
  name = "Ada Lovelace"
  url = "https://example.com/about/"

Images

#

For broad social-network compatibility, prefer a raster PNG or JPEG social image even though Hugo can resolve other published resources.