On this page
· 1 min read
Installation
This guide is example-local: it describes how to run and build examples/frameworks/with-vanilla-ejs/. For general Markdown and package behavior, see the main Pagesmith documentation.
Dependencies
Content + build — @pagesmith/site supplies the app-facing content layer, markdown pipeline, Vite plugins, and shared runtime/CSS used by this example. EJS renders templates at SSG time only. Pagefind is a dependency so the SSG plugin can index the generated HTML after vite build.
{ "dependencies": { "@pagesmith/site": "*", "ejs": "^5.0.1", "pagefind": "^1.5.0" }}Quick start
From the monorepo root:
git clone https://github.com/sujeet-pro/pagesmith.gitcd pagesmithvp installRun the dev server for this example:
vp run dev:eg:vanilla-ejsOr from this directory:
cd examples/frameworks/with-vanilla-ejsnpm run devProduction build (static HTML + Pagefind index):
cd examples/frameworks/with-vanilla-ejsnpm run buildOutput goes to ../../../gh-pages/examples/vanilla-ejs/ as configured in vite.config.ts.
What the Vite plugins do
sharedAssetsPlugin— Copies shared assets (for example fonts) from@pagesmith/siteinto the build output.pagesmithSsg— Dev: SSR middleware callingrender()fromsrc/entry-server.tsx. Production: runsgetRoutes/render, writes HTML, then runs Pagefind.
This example does not use pagesmithContent virtual modules. The SSR entry imports content.config.mjs and calls createContentLayer() from @pagesmith/site directly so templates stay decoupled from any framework loader.