---
title: "Binding Data"
description: "Binding Data in Markdown"
canonical_url: "https://nnsvn.me/products/nuxt-starter-kit/api/advanced/data-binding"
---

> Index of every page on this site: [llms.txt](https://nnsvn.me/llms.txt)

Using the [data binding feature](https://content.nuxt.com/docs/files/markdown#binding-data-in-markdown) from Nuxt Content, you can bind data within your Markdown document using the `{{ $doc.variable || 'defaultValue' }}` syntax. This allows you to define these values in the YAML frontmatter at the top of the document, or through the global variable in `docs.config.ts`.

## Document variable in YAML frontmatter

```mdc [example.md]
---
title: 'Title of the page'
description: 'Meta description of the page'
customVariable: 'Custom Value'
---

# The Title is {{ $doc.title }} and customVariable is {{ $doc.customVariable || 'defaultValue' }}
```

## Global Variable in `docs.config.ts`

```ts [docs.config.ts]
export const DOCS_CONFIG = {
  // ...
  data: {
    currentVersion: 'v1.0.0'
  }
};
```

```mdc [example.md]
# Current Version is {{ $doc.currentVersion || 'v1.0.0' }}
```

## Sitemap

See the full [sitemap](https://nnsvn.me/sitemap.md) for all pages.
