Branch preview

Preview any branch, commit, or pull request at a shareable ref URL before merging to main.

Shareable previews let teammates review documentation changes on docs.page before they merge to your default branch. Push a branch or open a pull request, then open a URL with a ~ref segment. No local CLI required.

Overview

Public GitHub hosting serves production docs from your default branch. Branch preview adds a ref segment so docs.page fetches docs.json and page files from a specific branch, commit, or pull request instead.

Use shareable previews when you need feedback from others, want to compare a branch against production, or need search, sitemap, or agent features that local preview does not include.

How it works

Ref URL patterns

Add ~{ref} immediately after the repository name:

text
https://docs.page/{owner}/{repo}~{ref}
https://docs.page/{owner}/{repo}~{ref}/{page-path}

Examples:

URL segmentResolves to
~feature-docsBranch feature-docs
~abc123… (40-character SHA)That commit
~42Pull request #42 head branch

Production URLs omit the ~ref segment entirely. docs.page resolves numeric refs to pull request head branches through the GitHub API.

When to use each preview mode

ModeWhenHow
Local previewFast iteration on your machine before pushdocs preview
Branch previewShare with reviewers after push~ref URL on docs.page
ProductionMerged default branchhttps://docs.page/{owner}/{repo}

Run docs check after local preview looks right and before you push for shareable preview.

GitHub App for pull requests

Install the GitHub App to post automatic pull request comments with live preview links. Each comment points at the ~ref URL for that PR's head branch so reviewers can open docs without constructing URLs manually.

Related

Local preview
Local preview

Iterate on theme and layout on your machine before you push.

Public GitHub hosting
Public GitHub hosting

How default-branch URLs become your production site.

GitHub App
GitHub App

Automatic PR comments with preview links.

Publish
Publish

Workflow for pushing a branch and sharing ref URLs with teammates.