## Documentation index

This index lists every available documentation page and its Markdown source.

- [Documentation](https://veta.varavel.com/docs/index.md)
  - [Getting Started](https://veta.varavel.com/docs/getting-started/index.md)
  - [Installation](https://veta.varavel.com/docs/installation/index.md)
  - [Guides](https://veta.varavel.com/docs/guides/index.md)
    - [Project Structure](https://veta.varavel.com/docs/guides/project-structure/index.md)
    - [Configuration](https://veta.varavel.com/docs/guides/configuration/index.md)
    - [Pages](https://veta.varavel.com/docs/guides/pages/index.md)
    - [Data](https://veta.varavel.com/docs/guides/data/index.md)
    - [Markdown](https://veta.varavel.com/docs/guides/markdown/index.md)
    - [Templates](https://veta.varavel.com/docs/guides/templates/index.md)
    - [Components](https://veta.varavel.com/docs/guides/components/index.md)
    - [Filters](https://veta.varavel.com/docs/guides/filters/index.md)
    - [Assets And Tailwind CSS](https://veta.varavel.com/docs/guides/assets-and-tailwind/index.md)
    - [Themes](https://veta.varavel.com/docs/guides/themes/index.md)
    - [Development Server](https://veta.varavel.com/docs/guides/development-server/index.md)
    - [Build And Output](https://veta.varavel.com/docs/guides/build-and-output/index.md)
    - [Deployment](https://veta.varavel.com/docs/guides/deployment/index.md)
  - [Reference](https://veta.varavel.com/docs/reference/index.md)
    - [CLI Reference](https://veta.varavel.com/docs/reference/cli/index.md)
    - [Config Reference](https://veta.varavel.com/docs/reference/config/index.md)
    - [Page Generators Reference](https://veta.varavel.com/docs/reference/page-generators/index.md)
    - [Template Context Reference](https://veta.varavel.com/docs/reference/template-context/index.md)
    - [Troubleshooting](https://veta.varavel.com/docs/reference/troubleshooting/index.md)
  - [API](https://veta.varavel.com/docs/api/index.md)
    - [JavaScript API](https://veta.varavel.com/docs/api/javascript/index.md)
    - [File API](https://veta.varavel.com/docs/api/files/index.md)
    - [HTTP Client](https://veta.varavel.com/docs/api/http-client/index.md)
    - [Parse API](https://veta.varavel.com/docs/api/parse/index.md)
    - [Template Functions](https://veta.varavel.com/docs/api/template-functions/index.md)
    - [Environment And Console](https://veta.varavel.com/docs/api/environment-and-console/index.md)
    - [Markdown Frontmatter](https://veta.varavel.com/docs/api/frontmatter/index.md)


## Documentation content

The documentation for the current page follows, reproduced verbatim.


# Template Context Reference

Veta templates receive a small root context:

```txt
data
pages
page
props
```

## `data`

Global data loaded from `data/`.

```html
{{ data.site.name }} {{ data.navigation.main }}
```

## `pages`

Array of all normalized pages.

```html
{% for item in pages %}
  <a href="{{ item.permalink }}">{{ item.title }}</a>
{% endfor %}
```

Each item includes the original page fields plus normalized fields such as `permalink`, `outputPath`, `template`, `generator`, and `index`.

The complete `pages` list exists after page generators have returned. It is not available while a generator is still creating that list.

## `page`

The current normalized page.

```html
<h1>{{ page.title }}</h1>
{{ page.content }}
```

For templated pages, `page.content` is the generator's unchanged, trusted string. Veta does not automatically render Markdown or resolve components before template rendering.

## `props`

Component props.

In page templates, `props` is usually empty.

In component templates, `props` contains tag attributes and `props.content`:

```html
<aside data-kind="{{ props.kind }}">
  {{ props.content }}
</aside>
```

Component context depends on where `parse.renderComponents(text)` is called. Page generators provide global `data`, but not `page` or `pages` because those pages are still being created. A context-bound JavaScript template function can pass its available runtime `page` and `pages` values into component rendering. Tag attributes and slot content always supply the rendered component's `props`.

## Template Helpers

Pongo templates and components can call built-in and custom template functions. `load_data` reads local or remote data:

```html
{% set navigation = load_data("data/navigation.yaml")|parse_yaml %}
{% set site = load_data("data/site.json")|parse_json %}
```

See [Template Functions](/docs/api/template-functions/) for details.

They can also call `url` to generate current-page-relative links:

```html
<a href="{{ url(page.permalink) }}">{{ page.title }}</a>
<link rel="stylesheet" href="{{ url("/styles.css") }}">
```

Custom functions from `functions/*.js` are available by file stem:

```html
{{ excerpt(page.content, 120) }}
```
