## 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.


# Page Generators Reference

Page generators return arrays of page objects:

```js
export default function({ parse }) {
  const { html } = parse.markdown("# Home");

  return [
    {
      permalink: "/",
      template: "base",
      title: "Home",
      content: html,
    },
  ];
}
```

## `permalink`

Required: yes

Type: string

The public URL path for the generated page.

Examples:

```txt
/
/about/
/feed.xml
/llms.txt
```

## `template`

Required: no

Type: string

Template name relative to `templates/`.

Examples:

```js
template: "base";
template: "pages/article.j2";
```

Do not prefix with `templates/`.

If omitted, the page is written as raw content.

## `content`

Required: no

Type: string

Defaults to an empty string.

For templated pages, content is passed unchanged and trusted to the selected template. Veta does not automatically render Markdown or resolve component tags. The generator must return the final format expected by the template, usually HTML. Use `parse.markdown(text)` and `parse.renderComponents(text)` explicitly when needed.

For template-less pages, content is written unchanged as raw output. It can contain HTML, Markdown, JSON, XML, text, or any other generated format.

A common content-file flow is:

```js
const { frontmatter, html } = parse.markdown(files.readFile(path));
const content = parse.renderComponents(html);

return {
  permalink: files.toPermalink(path, { stripPrefix: "content" }),
  template: "post",
  title: frontmatter.title,
  content,
};
```

## Extra Fields

Any extra fields are preserved and exposed as `page` in templates:

```js
{
  permalink: "/posts/hello/",
  template: "post",
  title: "Hello",
  date: "2026-06-30",
  tags: ["guide"],
  content: "<h1>Hello</h1>",
}
```

Template:

```html
<time>{{ page.date }}</time>
```

## Normalized Fields

Veta also exposes normalized fields on `page`:

```txt
content
generator
index
outputPath
permalink
template
```

`generator` is the page generator file path.

`index` is the page's index in that generator's returned array.

`outputPath` is the generated file path inside the output directory.

## Removed Field: `layout`

`layout` is rejected. Use `template` instead.
