Skip to content
Sign inJoin waitlist

Editing the content — Denzel Astro

All the words of this Astro template live in src/content/ and its photos in src/assets/images/: plain JSON files you edit while npm run dev shows them.

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

src/content/
site.json name, description, domain, logo, menu, search, socials, the sidebar, the footer
pages/home.json Home: its title and description, the slider, Editor's Pick, Trending, Latest
pages/blog.json the labels of the Blog, category, author and post pages
pages/not-found.json the 404 page
collections/*.json the posts, the categories and the authors
routes.ts the URL of every page
schemas.ts the fields each kind of item has, and which are required

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

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

Field Shown where
site.name The browser title suffix (“Business | Denzel”), share cards, the sidebar’s About box and the footer’s first column (for screen readers), the share image’s description. It is the template’s name in the demo: put your own.
site.title The browser title of a page that has none of its own. Every page sets its own; Home’s is meta.title in home.json.
site.description Search results and share cards of a page without its own description (only the style guide in the demo). 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 (src, /images/logo.svg) and its name for screen readers (alt), in the header, the sidebar’s About box and the footer (Making it look like your brand)
navigation The menu in the header (and the phone menu): Home, All Post, the four categories and Author (/author/anderson)
search The search button’s text and the search dialog’s name (label: “Search All”), the field’s placeholder, “No results found” (empty), and the phone menu button’s names “Menu” and “Close” (menuOpen, menuClose)
socials The Facebook, Twitter, Instagram and Pinterest icons of the header, the phone menu, the sidebar’s About box and the footer. name picks the icon (facebook, twitter, instagram or pinterest), label is its name for screen readers
sidebar The sidebar (below)
footer The footer: the text and email of the first column, the two posts of the second (posts: its title “Celebration” and two slugs), the newsletter box (newsletter: title, the line “Join 89,000 subscribers!”, placeholder, button, the success and error texts and the note under it) and the copyright line (copyright, where {year} becomes the current year)
labels viewAll: the “View All” link of the section titles (Editor’s Pick, Trending, Related Posts, More Articles by). The other entries are not used by the pages.

The demo’s e-mail (hello@example.com) is a placeholder: replace it. The social links open the networks’ home pages: point them to your own profiles, and remove an entry to hide its icon everywhere. “Join 89,000 subscribers!” is demo copy too. The copyright line says “Theme by Marcframe”: keep it or write your own.

Some details are written in more than one file, so change each copy:

Detail Where
Your site’s name site.name and logo.alt in site.json; meta.title and meta.description in home.json; the crumbs “Denzel” (category.crumbs, post.crumbs, author.home) and the descriptions with “on Denzel” (category.metaDescription, author.metaDescription, blog.meta.description) in blog.json; the copyright line
Your social links socials in site.json; each author’s own links are social in authors.json
The menu’s category links navigation in site.json names categories by address (/category/business): keep them in step with categories.json
The menu’s “Author” link /author/anderson in navigation: point it at an author who exists, or at your own page

Search src/content/ for “Denzel” and “example.com” to find the demo’s details.

There are three files in src/content/pages/. Change the text between the quotes, keeping the field names: the sections read them by name. Apostrophes are safe inside the double quotes, and the demo uses the typographic ’ in places. A double quote inside the text needs a backslash before it (\"). JSON has no comments and no comma after the last entry of a list; if the site stops building after an edit, that is usually why.

File Page or block
home.json Home: its meta (the browser title, shown as it is, without “ | Denzel”, and the description), the slider (slider: its name for screen readers and six slugs), “Editor’s Pick” (picks), “Trending” (trending) and “Latest” (latest: the title, count, the number of posts, 8, and the “View More” button). See Home’s picks.
blog.json blog: the Blog’s meta and its title (for screen readers; the page shows no heading). category: the breadcrumb before the name (crumbs: “Denzel / Blog”), the description of every category page (metaDescription, where {name} becomes the category) and the note shown when it has no post (empty). author: the breadcrumb’s first link (home), “Articles by:”, the social icons’ names (socialLabels), the description (metaDescription, followed by the start of the author’s bio) and empty. post: the breadcrumb (crumbs, then the post’s category), “Related Posts” and “More Articles by” with their count (3 each).
not-found.json The 404 page: its browser meta, the illustration (image), the title, the text and the button (back)

A meta holds the browser title and the description:

"meta": {
"title": "All Posts",
"description": "Every story on Denzel, newest first: business, technology, economy and fashion, with the author and date of each post."
}

title becomes the browser tab (“All Posts | Denzel”), and description the text in search results and share cards (80–160 characters). The category, author and post pages build theirs from the item (Pages and sections).

Home features posts by their slug, in home.json:

Field What it shows
slider.slugs The row of small posts under the header that slides by itself (six in the demo)
picks.lead, picks.slugs “Editor’s Pick”: the large post, then the two small ones beside it
trending.columns “Trending”: two columns, each a large post (lead) with an excerpt over two small ones (slugs)
picks.viewAll, trending.viewAll Where their “View All” link goes (/blog)

“Latest” is not picked: it shows the latest.count newest posts (eight), by date, whether or not they are featured above. The sidebar’s Recent and the footer’s two posts are picked the same way, in site.json (below).

Keep these slugs in step with posts.json. A slug in picks or trending that matches no post stops the build with Home: no post "<slug>"; an unknown slug in the slider, the sidebar or the footer is skipped and the list is one post shorter.

The sidebar sits beside the posts on Home, the category pages, the author pages and the posts (below them on phones and tablets). It has three boxes, set in sidebar of src/content/site.json:

  • About (about): the logo over a dotted map (background, widget-background.png), the text and the social icons.
  • Recent (recent): the title, the “View All” link (viewAll) and the four posts named by slug (posts), in that order.
  • Explore Topics (topics): the title, the categories named by slug (categories), each with its round photo and its number of posts followed by countLabel (“8 Post”).

The lists are read once per page by src/lib/sidebar.ts, which looks up the Recent posts and the topics’ categories by slug and counts each category’s posts; the sidebar itself is src/components/sections/Sidebar.astro. Recent does not follow the dates: change the slugs when you publish.

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

File What it feeds
posts.json The Blog (every post), one page per post (/blog/<slug>), Home (the picks by slug, the eight newest in “Latest”), the category and author pages, “Related Posts” and “More Articles by”, the sidebar’s Recent and the footer (by slug), and the search
categories.json One page per category (/category/<slug>), the category label of every card, the breadcrumb of a post, “Explore Topics” (by slug) and the search
authors.json One page per author (/author/<slug>), the name and photo on the cards and posts, “More Articles by” and the search

Order. Posts are sorted by date, newest first, everywhere they are listed (the Blog, “Latest”, the category and author pages, “Related Posts”, “More Articles by”); two posts of the same date keep their order in the file. A new post with today’s date goes first on its own. Categories and authors keep the order of their file; “Explore Topics” follows its own list of slugs.

The default category and author. “Uncategory” (uncategory, no photo) and “Admin” (admin, no photo, no social links) have no posts in the demo: their pages show “No posts in this category yet.” and “No posts by this author yet.”, and the search leaves them out until they have a post. Keep them for posts you haven’t filed yet, or delete them.

Copy an existing entry, paste it into the list (mind the comma between entries), and change the values:

{
"slug": "five-ways-to-read-more-this-year",
"title": "Five Ways to Read More This Year",
"excerpt": "Small habits that turn ten spare minutes into a book a month, from the bus ride to the last page before bed.",
"category": "fashion",
"author": "annabella",
"date": "2026-11-03",
"image": { "src": "/images/post-five-ways-to-read-more-this-year.jpg", "alt": "An open book on a café table beside a cup of coffee" },
"body": [
{ "type": "paragraph", "text": "First paragraph, with a **bold** phrase." },
{ "type": "heading", "level": 3, "text": "Start small" },
{ "type": "list", "ordered": false, "items": ["**First point:** its text.", "Second point."] }
]
}

Here’s what each field does:

  • slug is the URL: /blog/five-ways-to-read-more-this-year.
  • title is the card’s title, the post’s <h1> and its browser title.
  • excerpt is the summary under the title on the cards that show one (Trending’s large posts, “Latest”, the category and author lists). The search also matches it.
  • category is a category’s slug: the orange label on the cards (linking to the category page), the last crumb of the breadcrumb, and what decides “Related Posts”. A slug that matches no category shows the slug itself and links to a page that doesn’t exist.
  • author is an author’s slug: the name (and round photo) on the cards and under the post’s title, linking to the author’s page, and what decides “More Articles by”.
  • date ("2026-11-03") is shown as “Nov 3, 2026” (upper case on the cards), and sorts the lists.
  • image is the card’s photo, the cover of the post and the picture shown when the post is shared; alt describes it.
  • body is the article (rich text). Its first paragraph, after the title, is the post’s search description.
{
"slug": "travel",
"title": "Travel",
"description": "The text under the name on the category page.",
"image": { "src": "/images/category-travel.jpg", "alt": "A train crossing a valley at dawn" }
}
  • slug is the URL (/category/travel) and what posts write in their category.
  • title is the page’s title, the label on the cards and the topic’s name.
  • description is the text under the title of its page. The search matches it.
  • image is the photo beside the title of its page and the round photo in “Explore Topics”; null leaves the page with its text alone.

To show it in the menu, add { "label": "Travel", "href": "/category/travel" } to navigation in site.json; to show it in the sidebar, add "travel" to sidebar.topics.categories.

{
"slug": "jordan",
"name": "Jordan",
"bio": "The paragraph under the name on the author's page.",
"avatar": { "src": "/images/author-jordan.jpg", "alt": "Jordan" },
"social": { "facebook": "https://facebook.com/…", "twitter": null, "instagram": "https://instagram.com/…" }
}
  • slug is the URL (/author/jordan) and what posts write in their author.
  • name is shown on the cards, under a post’s title, on the author’s page and after “More Articles by”.
  • bio is the text of the author’s page and the end of its search description; the search matches it.
  • avatar is the round photo (100 px on the author’s page, 32 or 42 px beside the name); null shows the name alone.
  • social holds the three icons of the author’s page: facebook, twitter and instagram, each a URL or null to hide it.

Delete the entry (and the comma before it, if it was the last one). Its page and its sitemap entry disappear on the next build. Places that name an item by hand stay as they are: Home’s picks must not point at a deleted post (the build stops), the slider, Recent and the footer skip it, posts must not name a deleted category or author, and navigation and sidebar.topics.categories still list a deleted category.

src/content/schemas.ts is the reference: it lists every field and a comment for the ones that are not obvious. npm run check and npm run build report a missing field (a misspelled name counts as missing) with the collection, the item and the field.

A post’s body is a list of blocks:

"body": [
{ "type": "paragraph", "text": "A paragraph with a **bold** phrase." },
{ "type": "heading", "level": 3, "text": "A heading" },
{ "type": "heading", "level": 4, "text": "1. **A numbered heading**" },
{ "type": "list", "ordered": true, "items": [
{ "text": "**First point**", "ordered": false, "items": ["A sub-point.", "Another sub-point."] },
"Second point."
] }
]
  • Paragraphs: words between double asterisks (**…**) are set in bold. There are no italics, line breaks or links inside the text.
  • Headings: level 2 to 6 is the HTML tag (<h3> for 3). Levels 2 and 3 are set in the H3 style (22 px), 4 to 6 in the H4 style (18 px); bold runs in a heading are set in the black weight. The demo uses 3 and 4.
  • Lists: "ordered": true numbers the items (1., 2., …), otherwise each gets a bullet. An item is a string, or an object with its text and a nested list (ordered, items, a list of strings) shown under it with circles or numbers. Lists nest one level deep.
  1. Put the file in src/assets/images/.
  2. Refer to it in the content as /images/<file>, with an alt.

Astro resizes, compresses and converts the photos when the site builds, so each device gets a size that fits. The download’s placeholders show the size each photo was designed for; use photos at least as large:

Photos Demo size How it is shown
A post’s image (post-*.jpg) 1600 × 900 to 1600 × 2000 (most 1600 × 1067) The cover of the post (734 : 406), and the photo of every card: 477 : 430 (Editor’s Pick, large), 25 : 16 (the grid cards), 357 : 267 (Trending, large), a 150 px square (the lists; full width on phones), an 80 px square (Trending’s small posts, the slider, the footer), a 60 px circle (Recent)
A category’s image (category-*.jpg) 800 × 533 Beside the title of its page (336 : 234, 30 % of the width from tablets up, full width on phones), and a 52 px circle in “Explore Topics”
An author’s avatar (author-*.jpg) 120 × 120 A circle: 100 px on the author’s page, 42 px under a post’s title, 32 px on the cards
The sidebar’s background (widget-background.png) 360 × 232 Behind the logo in the About box
The 404 illustration (not-found.jpg) 800 × 600 4 : 3, 800 wide on desktops, 500 on tablets, full width on phones
The logo (logo.svg) SVG, 118 × 24 The header, the About box and the footer (Making it look like your brand)
The share image (public/opengraph-image.png) 2400 × 1260 Shared links (below)

Photos in a fixed frame are cropped to fill it, from the centre, so a photo of other proportions works, but you lose the edges the frame cuts. A post’s photo appears in many shapes, from tall to square to wide, so keep its subject in the middle. On hover, the card photos are drawn slightly larger and settle to their size (Making it look like your brand). A content path that points to a missing file stops the build with its name.

Every photo has an alt: a short description for screen readers and search engines. Write one for each photo you change (an empty "alt": "" marks a photo as decoration, as the sidebar’s background).

Files that browsers and social networks ask for by name live in public/:

File What it is
public/icon.svg The icon in the browser tab
public/apple-icon.png The icon 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)

The share image’s description for screen readers is shareImage.alt in src/lib/meta.ts, next to its size: change width and height there if your image has another size, and write a description of your own (the demo’s calls the site a template). Every page uses this image when shared, apart from the posts, which share their cover.

Almost every word is content, including the newsletter’s messages (footer.newsletter in site.json). The few interface words that never change per site live in the code:

  • “Main” (the menus’ name for screen readers) in src/components/site/Header.astro;
  • “Close search” and “Clear” (the search’s buttons, for screen readers) in src/design-system/components/navigation/SearchDialog.astro;
  • the “…” the newsletter button shows while sending, in src/design-system/scripts/newsletter.ts;
  • the date format (“Sep 14, 2023”) in src/lib/format.ts;
  • the share image’s description in src/lib/meta.ts;
  • the page’s language, lang="en", and og:locale in src/layouts/Layout.astro.

Search for the word and you will find it.

Terminal window
npm run check
npm run build

npm run check compares the collections with their schemas and the page copy with the sections that read it, and names the file and the field that is missing. A successful build means every page still renders and every image it shows exists. Neither checks that links written as text ("/category/business") lead somewhere: click through the site once with npm run preview after big changes. See Going live for the rest of the checklist.