# Add Author Pages to a VitePress Blog

Yes. An agent adds one page per author to a VitePress blog with dynamic routes, lists each author's posts, links the bylines, builds the site and opens a PR.

[Run this on Rush](https://cloud.getrush.ai/run/add-author-pages/vitepress/). Opens the console with this prompt ready to send, in a Project that has your repository.

## What the agent does

In a blog laid out like vuejs/blog, posts are Markdown files under `posts/` with `title`, `date`, `author`, `gravatar` and `twitter` in their front matter; `pnpm-lock.yaml` pins VitePress 1.3.4 and `package.json` names pnpm 9.8.0. The theme is custom, under `.vitepress/theme/`: `Layout.vue` renders `Home.vue` when the page's front matter has `index: true`, `NotFound.vue` when `page.isNotFound`, and `Article.vue` otherwise. `posts.data.ts` is a `createContentLoader('posts/*.md')` that keeps `title`, `url`, `date` and `excerpt`, sorted newest first, and drops the author. `Article.vue` renders `Author.vue`, which reads `author`, `gravatar` or `avatar` and `twitter` from the current page's front matter and prints the name as plain text. `genFeed.ts` writes `feed.rss` at `buildEnd`, and `vercel.json` sets `cleanUrls`. Two names appear across the posts, and one post carries no `author` line at all.

VitePress 1 supports dynamic routes, so the agent adds `authors/[author].md` and `authors/[author].paths.ts`. The paths file reads the front matter of every file under `posts/` with `gray-matter`, which is already a devDependency, and returns one `params` entry per distinct author with a slug of the name. A `slugifyAuthor` helper in the theme is used by that file, by the loader and by the byline, so the three never disagree on a URL. `posts.data.ts` gains `author`, `authorSlug`, `gravatar` and `twitter` in its `Post` interface and `transform`, which also lets the home page show bylines later without another loader.

An `AuthorPage.vue` component filters the loader's posts by `authorSlug` from `useData().params`, shows the avatar and name the way `Author.vue` does, and lists the posts with the same Tailwind classes `Home.vue` uses for its list, so the two pages read as one site. `Layout.vue` gets a branch for `params.author` ahead of the article branch. `Author.vue` wraps the name in a link to `/authors/<slug>/`. The post with no author stays off every author page and off the byline link, and the pull request names it so an editor can add the line.

In its sandbox the agent runs `pnpm install --frozen-lockfile` and `pnpm build`. VitePress fails a build on a dead link, so a wrong byline URL fails here instead of in production. It reads `.vitepress/dist/authors/` for one HTML file per author, opens an article's HTML to confirm the byline links to it, checks `feed.rss` is still written, and runs `pnpm preview` to request each author page with and without the trailing slash, since `cleanUrls` is on.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Add author pages to this VitePress blog. Read package.json, pnpm-lock.yaml, .vitepress/config.ts, .vitepress/genFeed.ts, every file under .vitepress/theme/ and the front matter of every post under posts/ first. Use VitePress dynamic routes: add authors/[author].md with a paths file that derives one route per distinct author from the posts' front matter, a shared helper that turns an author's name into a slug, and an author page component that lists that author's posts from the content loader, reusing the home page's list markup and the byline's avatar markup. Extend the content loader with the author fields. Link each article's byline to its author page. Leave posts without an author off the author pages and name them in the pull request. Do not change the RSS generation or the Vercel configuration. In the sandbox, install with the frozen lockfile, build, confirm one HTML file per author in the output and a byline link in an article, and preview the pages. Open a pull request whose description lists the author routes and quotes the build output.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
```

1. **Get an API key.** In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
3. **Read what came back.** Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

## What comes back

What comes back is a pull request that adds `authors/[author].md`, `authors/[author].paths.ts`, `.vitepress/theme/AuthorPage.vue` and the slug helper, and changes `posts.data.ts`, `Layout.vue` and `Author.vue`. `config.ts`, `genFeed.ts`, `vercel.json` and the posts themselves are untouched. The description lists the author routes the build produced, names the post with no `author` line, and quotes the `vitepress build` output, which passes only when every link resolves.

The run's record keeps the build log and the preview requests, so a reviewer can read the rendered author page HTML and the byline markup from an article without checking the branch out.

Before merging, a reviewer compares the author page against the home page in the preview to see that the list, dates and excerpts match, decides whether an author with one post deserves a page, and checks the slug helper against the names in the front matter, since a name with punctuation or a middle initial is where slug functions disagree.

## Run it on every VitePress blog

Author pages are added once per site. A developer sends this body to `POST /o/{org}/sessions` from a terminal or through the MCP server, with a `request_id` that is a UUID made once for the job, and goes back to writing. The pull request is on the session when the run completes; a question the agent ends on, such as whether to list co-authors, is answered with a follow-up to `POST /o/{org}/sessions/{id}/messages`, which wakes the same sandbox with `node_modules` still installed.

A company with several VitePress sites on the same theme sends the body once per repository from a script, with a `request_id` that is a UUID v5 of the repository's full name. Each run reads its own posts and theme; one whose posts name authors in an `authors` array gets one route per name in the array, and one that keeps author data in a separate JSON file gets its routes from that file.

## Why run it on Rush?

Dynamic routes in VitePress are easy to get almost right: the paths file returns the wrong shape, the slug on the byline differs from the slug in the route, the loader runs at build time while the component expects runtime data, or `cleanUrls` makes a link work in preview and fail on the host. In a Rush sandbox the agent builds the real site, reads the output directory and the rendered HTML, and lets the dead-link check judge the links before anything is opened.

The build log and the preview responses stay with the run, so the reviewer reads what the site produced rather than the component source. Several sites run in parallel, each with its own install from its own lockfile and its own pull request.

## Frequently asked questions

### Why dynamic routes instead of one Markdown file per author?

A file per author has to be created by hand when a new author writes a first post, and forgotten files produce dead byline links, which fail the build. With `[author].paths.ts` the routes are derived from the posts at build time, so a new author gets a page the moment a post names them.

### What about posts with no author?

They stay as they are, with no byline link and no entry on any author page, and the pull request names them. Adding an `author` line to a post is an editorial decision, not something the agent guesses.

### Does the RSS feed change?

No. `genFeed.ts` loads the posts itself and already writes each author's name into the feed items; it does not read the theme's loader and is left untouched.

### Will the author pages work with cleanUrls on Vercel?

Yes. VitePress writes `authors/<slug>.html`, which `cleanUrls` serves at `/authors/<slug>`, and the links the agent writes use that form. The preview in the sandbox requests each page both ways to confirm.

### Can the home page show bylines too?

The loader now carries the author fields, so `Home.vue` can print a byline per post with a few lines. The agent leaves the home page's layout as it is unless the request asks for it, and says in the pull request where the change would go.

## More VitePress jobs

- [Add a Dark Mode Toggle to a VitePress Blog With a Custom Theme](https://getrush.ai/run/add-dark-mode/vitepress/)
- [Add Dependabot to a VitePress Site](https://getrush.ai/run/add-dependabot/vitepress/)
- [Add a Build Check for a VitePress Docs Site on Every Pull Request](https://getrush.ai/run/add-docs-build-check/vitepress/)

## The same job on other stacks

- [Add Author Pages to a Wagtail Blog](https://getrush.ai/run/add-author-pages/wagtail/)
- [Add Author Pages to an Astro Blog](https://getrush.ai/run/add-author-pages/astro/)
- [Add Author Pages to a Jekyll Blog](https://getrush.ai/run/add-author-pages/jekyll/)

## Keep reading

- [How a Rush run works on your repository, from request to pull request](https://getrush.ai/cloud/)
- [Compare cloud agents, agent sandboxes and AI code review](https://getrush.ai/compare/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
