Skip to content

Your first site in 10 minutes

This guide starts from scratch and stops at a green astro build. The first page shows without an account: the starter ships a demo snapshot read offline. Count account creation separately, the rest fits in ten minutes.

  1. Create the project and run it

    The starter installs an Astro site with the Menestrel loader already wired and an offline fixture.

    Fenêtre de terminal
    npm create menestrel@latest my-site
    cd my-site
    npm run dev

    Open http://localhost:4321/. The home page, a service entry and the Menestrel badge show up, served by the embedded snapshot.

  2. Tour the template

    Three files are enough to understand the wiring:

    • src/content.config.ts: each collection declares loader: menestrelLoader({ collection: '...' }).
    • src/layouts/Layout.astro: <CmsSeo>, the richtext-styles.css sheet and <MenestrelBadge>.
    • src/pages/services/[slug].astro: getStaticPaths over the entries, <RichText> and <CmsImage> over the fields.
  3. Create a project and a token

    In the Menestrel admin, create a project, then an admin-scoped token. Keep it: menestrel init will drop it into an unversioned .env file.

  4. Connect the project and push the schema

    From the site root, init writes the config, the .env and the snippets to paste. sync sends your schema to the server.

    Fenêtre de terminal
    npx menestrel init --token cmt_adm_xxx
    npx menestrel sync --yes
  5. Edit, publish, build

    Edit an entry in the admin and publish it. Pull the published snapshot and run the build: the pages reflect the published content.

    Fenêtre de terminal
    npx menestrel pull
    npm run build

In production, do not depend on the admin at build time. Set MENESTREL_CONTENT_URL to the published snapshot URL: the build passes even if the application is down. See Environment variables.