Skip to content
Sign inJoin waitlist

Editing the content — Kendi Next.js

All the words and images of this Next.js template live in src/content/, in plain TypeScript files you edit while npm run dev shows the result.

No CMS is needed: text goes between quotes and items are separated by commas. If you would rather manage content in Sanity, Payload, Strapi or Directus, see Using a headless CMS.

src/content/
site.ts name, title, description, domain, menu, Categories menu, contact details, socials,
the sponsored ad, the sidebar, the newsletter, the footer
pages/home.ts the copy of the home page and the rules of its lists
pages/about.ts …and of every other page
collections/*.ts posts, categories, authors, legal pages, team, instagram
routes.ts the URL of every page
types.ts the fields each kind of item has

Not sure which file holds a piece of text? The page maps label every section of every page with its file.

src/content/site.ts holds what appears on every page:

Export Shown where
site.name The browser title suffix (“Latest Articles | Kendi”), share cards
site.title The browser title of the home page
site.description Search results and share cards of the home page, and of any page without its own description. It describes the template: write yours.
site.url Set this to your domain before publishing. Canonical links, share links, sitemap.xml and robots.txt are built from it.
logo The logo file (/images/logo.svg), its name for screen readers and where it links
navigation The menu in the header: Home, Articles, Categories (the item with dropdown: true opens the Categories menu), About, Authors
headerAction The header’s button, “Contact us”
categoriesMenu The Categories menu: how many categories it lists (categoriesCount, 5), its “More categories” link and the Spotlight title and count
breadcrumbs The first crumb (“Home”) and the separator (“>”)
contact The e-mail, the phone (phone as shown, phoneHref as dialled), the address and the hours: the Contact page
socials The X, Instagram and Facebook links: the sidebar, the footer and Contact
postMeta The “by” and “on” of a card’s meta line (“by Olivia Bennett · on Feb 17, 2026”)
sponsoredAd The ad on Home and in the sidebar (below)
sidebar The sidebar’s About text and “Follow us:”, Explore Topics (title, how many categories, the “More categories” link), the newsletter card’s texts and the Spotlight title and count
newsletter The band above the footer (“Stay updated with our letter”): title, text, how many photos, and the newsletter form’s texts — placeholder, button, the consent line and the success and error labels, shared by the sidebar card
footer The line about the magazine (about), the Navigation column, the Categories column (how many categories and the “More” link), the copyright ({year} becomes the current year) and the legal links
controls The names screen readers hear for the menu, the slideshow arrows and dots

The demo’s e-mail, phone and address are made up: replace all of them. The social links open the networks’ home pages: point them at your own profiles. Authors have their own social links in authors.ts.

The magazine’s name appears in several places: site.name, the copyright, the page copy (About, Contact, the page titles and descriptions) and the logo file. Search src/content/ for “Kendi” to find them all.

There is one file per page in src/content/pages/. Each exports the parts of that page and, for the pages with one address, a meta entry:

export const meta = {
"title": "About Us", // browser tab and share card
"description": "Kendi is an independent digital magazine…", // search results and share cards (80–160 characters)
};
export const crumb = "About"; // the breadcrumb's last item
export const title = "Independent journalism for curious minds";

Change the text between the quotes, keeping the field names: the sections read them by name. Apostrophes are safe inside double quotes, and the demo uses the typographic ’. A double quote inside a double-quoted string needs a backslash before it.

File Page
home.ts Home: the hero (eyebrow, title, lead, the newsletter box), the titles of Editor’s pick, Trending, Inspiration and Latest posts with their counts and rules (below), the “View more” link. Its browser title and description are its meta.
about.ts About: the breadcrumb, the title, the lead, three photos, the statement, two paragraphs, the “Contact us” line and button, the team’s title and lead (the members are team.ts)
blog.ts Articles (/blog): the breadcrumb, the title, how many posts load at a time (list.pageSize, 6) and what screen readers hear while more load
post.ts Every post page: the browser title and description patterns ({title}, {excerpt}), “Related Post” (title, count, the “View more” link)
categories.ts Categories (/category): the title, “From this category” and how many posts each category shows (preview.count, 2), “View articles”
category.ts Every category page: the title and description patterns, the breadcrumb’s middle item
authors.ts Authors (/author): the title, how many posts each author shows (preview.count, 4), “View articles”
author.ts Every author page: “Archives for {name}”, the description pattern, the breadcrumb’s middle item
contact.ts Contact: the title, the lead, the labels of the details and the contact form (Forms)
legal.ts “Last updated: “ on the legal pages, and their title pattern
not-found.ts The 404 page: its browser title, “404”, the title, the text and the button

src/content/collections/ holds the lists the site builds pages and sections from:

File What it feeds
posts.ts One page per post; Articles; every list of Home; the newsletter band’s photos; the sidebar’s Spotlight; the Categories menu’s Spotlight; a category’s and an author’s page; “Related Post”
categories.ts One page per category; Categories; the Categories menu (the first five), the sidebar’s Explore Topics (the first six), the footer’s Categories column (the first five); the pill on every post card
authors.ts One page per author; Authors; the author line on cards and posts
legal.ts One page per legal text: /legal/terms-of-service, /legal/privacy-policy
team.ts “Meet the Team” on About (not the authors: the team has no pages)
instagram.ts The footer’s photo grid, four photos with a link each

Categories, authors, the team and the photo grid show in the order of their file. Posts are sorted by date, newest first (posts of the same day keep the order of the file), so a new post goes anywhere in posts.ts: its date puts it in place.

Copy an existing entry, paste it, and change the values:

{
"slug": "my-first-post", // the URL: /blog/my-first-post
"title": "My First Post", // the card, the page title, the browser title
"excerpt": "One or two sentences…", // under the title, the card text and the search description
"category": "lifestyle", // a slug of categories.ts: the pill, the breadcrumb, the category page
"author": "olivia-bennett", // a slug of authors.ts: the meta line and the author page
"date": "2026-03-12", // shown as "Mar 12, 2026"; sorts the lists
"editorsPick": true, // optional: Home's Editor's pick
"trending": true, // optional: Home's Trending and the Categories menu's Spotlight
"image": { "src": "/images/post-my-first-post.jpg", "alt": "…" }, // the card, the cover and the share image
"body": [ …rich text… ] // the article (below)
}

A new post gets its page, its card on Articles, its category’s and its author’s pages and its sitemap entry on the next build. Home’s lists take it in when it is among the newest, flagged, or the newest of its category (Inspiration) (below).

Add Fields
Category slug, name, description (the category page’s lead and search description, the Categories page, the menu) and image ({ src, alt }: the square tile and the page’s photo). Posts join it through their category.
Author slug, name, role, bio (the author page and the search description), avatar ({ src, alt }) and socials (a list of { name: "x" | "instagram" | "facebook", href })
Team member (team.ts) slug (an id), name, role, bio, photo ({ src, alt })
Photo of the footer grid (instagram.ts) image ({ src, alt }) and href (where it links)

The Categories menu and the footer show the first five categories, Explore Topics the first six: the order of categories.ts decides which. The footer’s grid is laid out for four photos.

Delete the entry. Its page and its sitemap entry disappear on the next build. Move the posts of a category or an author before you remove it: a post that names a missing slug shows the slug itself as its category or author name, and links to a page that no longer exists. The footer’s legal links are typed: remove a legal page’s link from footer.legalLinks in site.ts too.

src/content/types.ts is the reference: it lists every field and a comment for the ones that are not obvious. Your editor shows the same information while you type.

Home has no list of its own: each block takes posts from posts.ts by a rule, written next to its count in src/content/pages/home.ts.

Block Rule Change it with
Hero slideshow The five newest posts; it turns by itself every 8 seconds hero.slider (from, count)
The list beside the slideshow The 5th to 7th newest (the 5th is also the last slide; tablets show one more) hero.list
Editor’s pick Posts with "editorsPick": true, newest first: the first large, the next four as a list the flags; editorsPick.count (5)
Trending Posts with "trending": true, newest first: two columns of one large card and two small the flags; trending.count (6)
Inspiration The newest post of each category, in the order of the categories. It is a looping carousel. the rule: getNewestPerCategory in src/lib/content.ts
Latest posts The 8th to 11th newest, and “View more” to Articles latest (from, count)

Elsewhere the rules are fixed in the code: the sidebar’s Spotlight shows the four newest posts, the Categories menu’s Spotlight the first four trending posts, the newsletter band the covers of the three newest; a post’s “Related Post” the six newest others of its category (four on tablets and phones); Categories the two newest posts of each category, Authors the four newest of each author; a category’s and an author’s page all of their posts, newest first.

The Terms of Service and the Privacy Policy in src/content/collections/legal.ts are generic texts with placeholders in square brackets: [Your Company Name], [URL], [Contact Information], [Your Jurisdiction], [Arbitration Location] and [Link to Privacy Policy]. They are not ready to publish as they are. Replace every placeholder (search the file for [), make the texts say what your site really does — the newsletter, the contact form, any analytics — and have them checked for the law where you publish. updated is the date shown as “Last updated: Aug 10, 2025”.

The footer links both pages (footer.legalLinks in site.ts), and the newsletter’s consent line links them too (newsletter.form.consent).

Home shows an ad after Editor’s pick (a wide card) and the sidebar ends with one (a tall card, with the logo and no name). Both come from sponsoredAd in src/content/site.ts:

export const sponsoredAd = {
"label": "- Sponsored Ad -", // the line above the ad
"name": "Tenq Tech", // the advertiser (wide card)
"text": "Smarter tools for modern teams…",
"image": { "src": "/images/ad-tenq-tech.jpg", "alt": "…" },
"logo": { "src": "/images/ad-tenq-tech-logo.svg", "alt": "Tenq" },
"cta": { "label": "Learn more", "hint": "about Tenq Tech", "href": "/contact" },
};

Tenq Tech is a made-up advertiser, and its “Learn more” button leads to your own Contact page, so the slot works as an “advertise with us” placeholder. Replace it with your own ad — a sponsor, your own product, your newsletter — and point cta.href at its page (a full address for another site). cta.hint is read by screen readers and search engines after the label but not shown (“Learn more about Tenq Tech”): give it your advertiser’s name, or remove it. To remove the ad, delete <AdCard … /> in src/components/sections/home/HomeMainSection.tsx and in src/components/sections/Sidebar.tsx.

A post body and a legal text are a list of blocks:

"body": [
{ "type": "heading", "level": 2, "text": "Why Habits Matter" },
{ "type": "paragraph", "text": "Plain text with a **bold** run, an _italic_ one and a [link](/blog)." },
{ "type": "list", "ordered": false, "items": ["First item", "Second item"] }, // ordered: true for numbers
]
  • Headings (level 2 to 6): the posts use 2 and 3, the legal pages 3. In a post, level 3 is drawn a step smaller than level 2; elsewhere every level has the rich-text heading style. The legal pages pass topLevel={2} to RichText: their highest heading is rendered as h2 (the others below it) so the headings follow the page’s h1 in order, the look unchanged.
  • Inline marks: **bold**, _italic_ and text links (an address starting with / stays on the site).
  • Lists: each item is a line of text, with the same inline marks.
  1. Put the file in public/images/.
  2. Refer to it in the content as /images/<file> (the path starts at public).

Sizes and formats are handled for you: pages use next/image, which serves a scaled, modern format per device. The download’s placeholders show the size each photo was designed for; use photos at least as large:

Photos Demo size
A post’s image (the cards, the hero slides, the cover and the share image) 1600 × 1067 (3 : 2)
A category’s image (the square tile and the photo of its page) 400 × 400
An author’s avatar 400 × 400
A team member’s photo (About) 400 × 600
The three photos of About one 1200 × 1800 and two 800 × 533
The footer’s photo grid 400 × 400
The sponsored ad’s image 1200 × 900 (its logo is an SVG)

Photos in a fixed frame are cropped to fill it, so a photo of other proportions works, but you lose the edges the frame cuts. Frames that follow the screen change shape between phone, tablet and desktop (a post cover is wide on a card and tall on a hero slide), so keep the subject away from the edges.

Every photo written as { src, alt } has an alt: a short description for screen readers and search engines. Write one for each photo you change.

Two things sit outside the content because browsers and social networks ask for them by name:

File What it is
src/app/icon.svg, src/app/apple-icon.png The icon in the browser tab and on a phone’s home screen (180 × 180)
public/opengraph-image.png The picture shown when someone shares a link (2400 × 1260; 1200 × 630 or larger works)

The share image’s description for screen readers is shareImage.alt in src/lib/meta.ts, next to its size: change them if your image has another size, and write a description of your own. Every page uses this image when shared, except the post, category and author pages, which share their own photo.

Almost every word is content, including the forms’ messages. The few interface words that never change per site live in the code:

  • the date format of posts and legal pages (“Mar 12, 2026”) in src/lib/format.ts;
  • the page’s language, lang="en", in src/app/layout.tsx;
  • the forms’ fallback labels in the design system, used only when the copy gives none.

Search for the word and you will find it.

Terminal window
npm run build

A successful build means every content file has the fields it needs and every page still renders. It doesn’t check that the images exist or that links written as text ("/contact") lead somewhere: click through the site once with npm start after big changes. See Going live for the rest of the checklist.