Skip to content
Sign inJoin waitlist

Using a headless CMS — Metuo Next.js

Connecting a headless CMS works the same for every Next.js template sold on Framebrick, so this page lists only what is specific to Metuo.

The approach, rich text, images, keeping pages fresh, and step-by-step guides for Sanity, Payload, Strapi and Directus are in Use a headless CMS with a Next.js template.

Pages read them through src/lib/content.ts: getPosts / getPost / getRelatedPosts, getLegalPages / getLegalPage, getServices, getTestimonials and getTeam. Mirror src/content/types.ts in the CMS:

Collection In the demo Fields
Post (posts.ts) 12 slug, title, excerpt, image, imageAlt, category (text), date, body (rich text)
LegalPage (legal.ts) 2 slug, title, updated (a date), body (rich text)
Service (services.ts) 6 slug, name, summary, image, images (two images), imageAlts (three texts: the main image, then the two), values (lines, four in the demo)
Testimonial (testimonials.ts) 6 slug, name, role, photo, headline, quote, image, imageAlt, outcomes (lines, three in the demo)
Member (team.ts) 6 slug, name, role, photo, bio

Images are paths or addresses (image: string); their descriptions sit in their own fields (imageAlt, imageAlts). Dates are ISO dates ("2026-05-28").

  • Related posts. “More insights for you.” under a post are the other posts with the same category, up to three (related.count in src/content/pages/post.ts), in list order (getRelatedPosts). category is plain text, matched exactly: a CMS option list or a reference to a category, mapped to its name, both work. The block is left out when no other post shares the category.
  • Order. Lists keep the order they arrive in; nothing is sorted by date. Posts are newest first in the demo (Blog, Home, related posts), so sort by date descending in your query. Home shows the first four services (service.count in src/content/pages/home.ts), the first four stories (stories.count) and the first three posts (slice(0, 3) in src/app/page.tsx); Blog shows six posts at a time (list.pageSize in blog.ts); the Service page, the Testimonial page and About show every service, story and member in list order.
  • Services in the form. The booking form’s “Preferred session type” checkboxes are the names of every service, so a service added in the CMS becomes a choice after the next build.
  • No pages of their own. Services, stories and team members are only listed; their slug is an identifier. Posts and legal pages get a page each (/blog/<slug>, /legal/<slug>), and the sitemap reads the same functions. The footer’s legal links are written in footer.legalLinks (src/content/site.ts), not read from the collection.
  • The founder, her quote, the plans, the questions, the figures and the booking form are page copy in src/content/pages/, not collections.

A post’s body and a legal page’s body are blocks, not HTML:

{ type: "heading", level: 3, text: "…" } // drawn as Heading 3, whatever the level
{ type: "paragraph", text: "…" } // **bold** between double asterisks, *italic* between single ones, "\n" for a line break
{ type: "list", ordered: false, items: [[{ type: "paragraph", text: "…" }], …] } // each item is its own list of blocks

The demo’s texts use headings, paragraphs, bulleted lists, bold and italics; numbered lists (ordered: true) work too. There are no links or images inside the text. Convert your CMS’s rich text to these blocks in your mapping function, bold as **…** and italics as *…* (how).

Every photo sits in a frame and is cropped to fill it, so a photo of other proportions works; upload images at least as large as the layout uses:

Image Size
A post’s image (the card at 367 : 244 and the cover of its page, full width up to 1140 px) 2280 × 1520
A service’s image (400 × 500 beside Home’s rows on desktops, 320 px wide on the Service page’s card) 800 × 533 or larger
A service’s images (the two small photos, 3 : 2) 400 × 267 or larger
A story’s image (up to 570 px wide on Home’s card, 520 px on the Testimonial page) 1140 × 760
A story’s photo (the small portrait, up to 100 px) 200 × 300
A member’s photo (2 : 3, up to 375 px wide) 750 × 1125

Photos go through next/image, which needs the CMS’s host in images.remotePatterns of next.config.ts (Images). Every photo fills a frame of its own shape, so the layout needs no width and height from the CMS.