Editing the content — Kendi Astro
All the words and images of this Astro template live in src/content/, in plain JSON files you edit while npm run dev shows the result.
No CMS is needed: text goes between double quotes and items are separated by commas (none after the last one). If you would rather manage content in Sanity, Payload, Strapi or Directus, see Using a headless CMS.
src/content/ site.json name, title, description, domain, menu, Categories menu, contact details, socials, the sponsored ad, the sidebar, the newsletter, the footer pages/home.json the copy of the home page and the rules of its lists pages/about.json …and of every other page collections/*.json posts, categories, authors, legal pages, team, instagram routes.ts the URL of every page schemas.ts the fields each kind of item has, and which are requiredNot sure which file holds a piece of text? The page maps label every section of every page with its file.
Your details first
Section titled “Your details first”src/content/site.json 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.json.
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.
Page copy
Section titled “Page copy”There is one file per page in src/content/pages/. Each holds the parts of that page and, for the pages with one
address, a meta entry:
{ "meta": { "title": "About Us", "description": "Kendi is an independent digital magazine…" }, "crumb": "About", "title": "Independent journalism for curious minds"}meta.title is the browser tab and the share card, meta.description the search results and share cards (80–160
characters), crumb the breadcrumb’s last item. JSON has no comments, and a missing or extra comma breaks the file:
npm run dev names the file and the line.
Change the text between the quotes, keeping the field names: the sections read them by name. Apostrophes are safe
inside the quotes, and the demo uses the typographic ’. A double quote inside a text needs a backslash before it (\").
| File | Page |
|---|---|
home.json |
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.json |
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.json) |
blog.json |
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.json |
Every post page: the browser title and description patterns ({title}, {excerpt}), “Related Post” (title, count, the “View more” link) |
categories.json |
Categories (/category): the title, “From this category” and how many posts each category shows (preview.count, 2), “View articles” |
category.json |
Every category page: the title and description patterns, the breadcrumb’s middle item |
authors.json |
Authors (/author): the title, how many posts each author shows (preview.count, 4), “View articles” |
author.json |
Every author page: “Archives for {name}”, the description pattern, the breadcrumb’s middle item |
contact.json |
Contact: the title, the lead, the labels of the details and the contact form (Forms) |
legal.json |
“Last updated: “ on the legal pages, and their title pattern |
not-found.json |
The 404 page: its browser title, “404”, the title, the text and the button |
Collections
Section titled “Collections”src/content/collections/ holds the lists the site builds pages and sections from:
| File | What it feeds |
|---|---|
posts.json |
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.json |
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.json |
One page per author; Authors; the author line on cards and posts |
legal.json |
One page per legal text: /legal/terms-of-service, /legal/privacy-policy |
team.json |
“Meet the Team” on About (not the authors: the team has no pages) |
instagram.json |
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.json: its date puts
it in place.
Adding a post
Section titled “Adding a post”Copy an existing entry, paste it, and change the values (the comments here explain the fields; JSON itself takes none):
{ "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.json: the pill, the breadcrumb, the category page "author": "olivia-bennett", // a slug of authors.json: 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).
Adding a category, author or team member
Section titled “Adding a category, author or team member”| 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.json) |
slug (an id), name, role, bio, photo ({ src, alt }) |
Photo of the footer grid (instagram.json) |
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.json decides which. The footer’s grid is laid out for four photos.
Removing an item
Section titled “Removing an item”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.json too.
What each field means
Section titled “What each field means”src/content/schemas.ts is the reference: it lists every field, which are required, and a comment for the ones that are
not obvious. npm run check reads every collection against it and names the item and the field that is wrong.
How Home picks its posts
Section titled “How Home picks its posts”Home has no list of its own: each block takes posts from posts.json by a rule, written next to its count in
src/content/pages/home.json.
| 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.
Legal pages
Section titled “Legal pages”The Terms of Service and the Privacy Policy in src/content/collections/legal.json 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.json), and the newsletter’s consent line links them too
(newsletter.form.consent).
The sponsored ad
Section titled “The sponsored ad”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.json:
"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/HomeMainSection.astro and in src/components/sections/Sidebar.astro.
Rich text
Section titled “Rich text”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"] }]- Headings (
level2 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 passtopLevel={2}toRichText: their highest heading is rendered ash2(the others below it) so the headings follow the page’sh1in order, the look unchanged. - Inline marks:
**bold**,_italic_andtextlinks (an address starting with/stays on the site). - Lists: each item is a line of text, with the same inline marks.
Images
Section titled “Images”- Put the file in
src/assets/images/. - Refer to it in the content as
/images/<file>: the site finds it insrc/assets/images/(a missing file stops the build withImage /images/<file> not found).
Sizes and formats are handled for you: Astro resizes every photo when the site builds and 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 |
|---|---|
public/icon.svg, public/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.
Text that is not in content/
Section titled “Text that is not in content/”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", insrc/layouts/Layout.astro; - the forms’ fallback labels in the design system, used only when the copy gives none.
Search for the word and you will find it.
After editing
Section titled “After editing”npm run checknpm run buildA successful check and build mean 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 run preview after big changes. See Going live for the rest of the checklist.