# Build Output

Build Pages writes internal working files to:

```txt
.zeropress-build-page/
  build-pages-config.json
  preview-data.json
  build-report.json
  public-assets/
```

These files help inspect the resolved build state. They are not the public output directory.

## Internal Working Directory

`.zeropress-build-page/` is generated in the current working directory.

- `build-pages-config.json`: resolved user-facing Build Pages config.
- `preview-data.json`: internal generated build input passed to `@zeropress/build`.
- `build-report.json`: summary of discovered Markdown, skipped files, front page mode, and output paths.
- `public-assets/`: staged public root used by the underlying build.

Do not edit these files as source. They are regenerated on each build.

## Static Output

The destination directory receives deployable files:

```txt
_site/
  index.html
  assets/
  _zeropress/
  sitemap.xml          when site.url is configured
  robots.txt
```

Common output:

- HTML pages generated from Markdown.
- Hashed theme assets such as `assets/style.<hash>.css`.
- `/_zeropress/search.js`, `/_zeropress/search.json`, and `/_zeropress/search_pagefind.js` when search is enabled.
- `sitemap.xml`, when `site.url` is configured.
- fallback `robots.txt`, unless public `robots.txt` exists.
- copied public files.
- copied Markdown source files, unless `--no-copy-markdown-source` is used.

## Source Config

Do not confuse generated working files with source config files:

```txt
docs/.zeropress/config.json
```

The source `.zeropress/` directory is authored by the site owner. The workspace `.zeropress-build-page/` directory is generated by Build Pages.

## Public Files

Public files come from `--public-dir`, or from `--source` when `--public-dir` is omitted.

Public root files can override or influence generated special files:

- `robots.txt`: copied as-is and prevents fallback robots generation.
- `favicon.ico`, `favicon.svg`, `favicon.png`, `apple-touch-icon.png`: copied to the destination and auto-injected into generated HTML `<head>` output.
- `sitemap.xsl`: copied to the destination. When ZeroPress generates `sitemap.xml`, it auto-discovers that file and adds an XML stylesheet processing instruction for `/sitemap.xsl`.

## Markdown Source Copy

By default, source Markdown files are copied to the generated output and the bundled docs theme can show `View this page as Markdown`.

Use:

```bash
zeropress-build-pages --source ./docs --destination ./_site --no-copy-markdown-source
```

to publish HTML without original Markdown source files.

## Ignore In Git

Most projects should ignore generated directories:

```gitignore
/.zeropress-build-page/
/_site/
```

If you build with an older published package that writes internal files to `./.zeropress/`, ignore that generated root as well while keeping `<source>/.zeropress/` tracked.
