with one click
new-page
// Scaffold a new merjs page. Use when the user wants to create a new page, route, or view.
// Scaffold a new merjs page. Use when the user wants to create a new page, route, or view.
Add streaming SSR to a merjs page. Use when the user wants shell-first rendering, skeleton placeholders, or parallel data fetching that resolves inline.
Full production build — codegen, compile, prerender, and prepare for deployment.
Build and start the merjs dev server with hot reload. Use when the user wants to run, start, or serve the project.
Scaffold a new merjs API route. Use when the user wants to create a new API endpoint.
Work with the merjs Zig web framework. Use when creating pages, API routes, WASM modules, or modifying the merjs build system. Provides conventions for file-based routing, SSR, dynamic routes, type-safe APIs via dhi, sessions, and Cloudflare Workers deployment.
| name | new-page |
| description | Scaffold a new merjs page. Use when the user wants to create a new page, route, or view. |
| argument-hint | [page-name] |
| disable-model-invocation | true |
Scaffold a new page at app/$ARGUMENTS.zig that follows the merjs conventions.
app/$ARGUMENTS.zig with this template:const mer = @import("mer");
const h = mer.h;
pub const meta: mer.Meta = .{
.title = "PAGE_TITLE",
.description = "PAGE_DESCRIPTION",
};
const page_node = page();
pub fn render(req: mer.Request) mer.Response {
return mer.render(req.allocator, page_node);
}
fn page() h.Node {
return h.div(.{ .class = "page" }, .{
h.h1(.{}, "PAGE_TITLE"),
});
}
zig build codegen to regenerate routessrc/generated/routes.zigpub const meta: mer.Metapub fn render(req: mer.Request) mer.Responseh DSL (mer.h) for HTML — prefer comptime nodesapp/users/[id].zig → /users/:idapp/index.zig maps to /app/foo/index.zig maps to /foopub const prerender = true; for static pages that don't need request data