Skip to content
Sign inJoin waitlist

Editing the content — Marai Neesu 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 the result.

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, title, description, domain, you as the logo, the e-mail, the menus and the footer
pages/home.json the copy of the home page
pages/about.json …and of every other page
pages/shared.json labels several pages use (breadcrumbs, the testimonials' rating, the slideshow's arrows)
collections/*.json projects, products, posts, services, testimonials, experiences, tools, socials
routes.ts the URL of every page
schemas.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.json holds what appears on every page:

Field Shown where
site.name The browser title suffix (“About | Marai Neesu”), share cards
site.title The browser title of a page that has none of its own (Home has its own, meta.title in home.json)
site.description Search results and share cards of any page without its own description (the 404 page). 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.
person You, as the header’s logo: avatar (a round photo, 34 px in the header and 90 px on the CV), name, location, verifiedLabel (the name screen readers hear for the verified seal beside your name on desktops) and hoverLines, the two lines that replace your name and place while the pointer is over the logo (“Back to” / “Homepage”)
navigation The menu of desktops and tablets: Home, Portfolio, About, Service
phoneNavigation The phone menu, which also lists Product, Course and Blog
contactLink The “Contact” button of the header (and of the phone menu)
menuLabels The phone menu button’s two labels (“Menu”, “Close”) and the menu’s name for screen readers (“Main”)
contact.email Your e-mail: the address in the Home hero, and the “Email Me” / “Email me” links of the services and the questions
footer The footer: the call to action (ctaLabel, ctaTitle, the “View my Cv” button cvLink and the “Contact Me” link contactLink), the two link columns (columns), the third column’s city and its time zone (city, timeZone) with the ways to reach you under it (reach), the profiles of the bottom row (profiles), the copyright (copyright, where {year} becomes the current year, and rights), the credit line (credit) and the “Contact Me” link at the bottom right (endLink)

The footer’s third column shows the city and the time there, which follows the clock: timeZone is an IANA time zone ("Europe/Lisbon", "America/New_York"). The reach links are typed: the e-mail there (mailto:hello@example.com) is not read from contact.email, so change both.

The demo’s e-mail (hello@example.com) and its links (Discord, Calendly, Dribbble, Behance, Instagram, Twitter, the CV’s contact links, the services’ “More Details”) are placeholders that open the networks’ home pages or example.com: point them to your own pages. Links that start with https:// open in a new tab; mailto: links open the visitor’s mail app.

The person’s name appears in many places: site.name, person, the copy of most pages (the About text, the CV, the greeting of the Home hero, the page descriptions) and the testimonials’ quotes. Search src/content/ for “Marai Neesu”, “Neesu” and “Dubai” to find them all.

There is one file per page in src/content/pages/. Most hold the sections of that page and a meta entry:

{
"meta": {
"title": "About",
"description": "Marai Neesu, a digital designer based in Dubai: the story, the experience in product and web design…"
},
"breadcrumb": "About",
"title": "Hello, I am Neesu a digital designer based in Dubai…"
}

title becomes the browser tab (“About | Marai Neesu”), and description the text in search results and share cards (80–160 characters). 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 ’. 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
home.json Home: its meta (shown as it is, without the site’s name), the hero (the title, the portrait, the greeting, the rolling roles, the intro, “More About me”, the labels over the e-mail and the social tiles), “My latest work” (projects.count, how many projects), “Work with Me” (the price line, “More Details” and the custom-request row), “Trusted by Professionals”, “Products Spotlight” (how many products on desktops, tablets and phones), the course banner (course) and “Latest Articles & Publications” (blog.count)
about.json About: the breadcrumb, the long title, the three photos and two paragraphs (intro), “My Experiences” with its two buttons, and the title of the Stack
projects.json Projects (/project): the title and lead, and “My Awesome Clients” with the client logos (clients.logos)
project.json The words shared by every project page: the meta labels (Client, Service, Date), “Project Overview”, “Key Highlights”, “See more projects” (more.count, how many) and “Go Back”
services.json Services (/service): “Work with Me” (the same words as on Home, in their own copy) and the questions (faq)
courses.json Course (/course): the title band and its cover, About Course, the four modules and their lessons (“Free Preview” links are optional), the outcomes, the overview card (its features, the price and “Enroll Today”) and the questions
cv.json CV (/cv): the profile (the “Available for work” chip, the greeting, the rolling roles), About, Contact (three links), Education, how many projects, jobs and posts it lists (count), and the Certifications
products.json Products (/product, under products) and the words of every product page (product: “Live Demo”, “Buy - {price}”, “Overview”, “More Products” and how many on each screen, “Go Back”)
blog.json Blog (blog: the title, pageSize and “Load More”), the newsletter (newsletter, with its form) and the words of every post page (post)
contact.json Contact: the page (contactPage: its meta, the breadcrumb, the title and the lead) and the inquiry form (contactForm) (Forms)
shared.json The rating’s words for screen readers (“Rated {rating} out of 5”), the testimonial slideshow’s arrows and the breadcrumb’s labels
not-found.json The 404 page: its browser title (meta.title), “/404”, the title, the text and the button

A few blocks appear on more than one page, and each page’s file holds its own copy of them: “Work with Me”, the questions’ headings and “Have more questions?”, and the titles of the project, product and post lists. Change them in every file that has them (Pages and sections lists where).

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

File What it feeds
projects.json Projects (every project), one page per project, Home (the first four: projects.count in home.json), “See more projects” at the end of a project page (the first two others) and the CV’s Project list (the first four: projects.count in cv.json)
products.json Products (every product), one page per product, Home (the first six; four on tablets, three on phones) and “More Products” at the end of a product page (the first three others; four on tablets)
posts.json The Blog (six at first, then every post behind “Load More”), one page per post, Home (the first three; two on tablets), “See more posts” at the end of a post (up to three other posts of its category; two on tablets) and the CV’s Writing (the first four)
services.json “Work with Me” on Home and Services (every service), the choices of the contact form’s “I’m interested in”, and the link of a project’s service badge
testimonials.json “Trusted by Professionals” on Home (every testimonial: a ticker on tablets and desktops, a slideshow on phones)
experiences.json “My Experiences” on About (every job) and the CV’s Work Experience (the first four: experience.count in cv.json)
tools.json The Stack on About (every tool)
socials.json The social tiles under the e-mail in the Home hero

The order of the items in the file is the order on the site. The Blog doesn’t sort posts by date: the demo lists them newest first, so put a new post first to show it first. Every post is in the Blog’s HTML from the start, so search engines find them all; “Load More” only shows the rest.

Copy an existing entry, paste it after the last one (mind the comma between entries), and change the values:

{
"slug": "my-project",
"title": "My Project - Brand Website",
"summary": "A website for a small studio, from the first sketch to launch.",
"service": "Web Design",
"date": "2024-06-01",
"client": "Studio Name",
"image": { "src": "/images/project-my-project-cover.jpg", "alt": "The home page of the site on a laptop" },
"description": [{ "type": "paragraph", "text": "What the project was and how it went." }],
"highlights": [{ "type": "paragraph", "text": "**Result:** what changed for the client." }],
"gallery": [
{ "src": "/images/project-my-project-gallery-1.jpg", "alt": "…" },
{ "src": "/images/project-my-project-gallery-2.jpg", "alt": "…" },
{ "src": "/images/project-my-project-gallery-3.jpg", "alt": "…" }
]
}

Here’s what each field does:

  • slug is the URL: /project/my-project.
  • title is the card’s title, the page’s title and its browser title, and the CV line’s link.
  • summary is shown on the card (two lines at most), under the title of the page, on the CV, and is the page’s search description.
  • service is shown on the card and as the page’s Service, and is the badge above the title. It should be the title of one of the services: the badge then links to that service’s url (in a new tab); a name that isn’t a service links to the Services page.
  • date is the month, written as its first day ("2024-06-01") and shown as “June 2024”.
  • client is the page’s Client and the CV line’s subtitle.
  • image is the card’s photo and the photo beside the title (both 4 : 3).
  • description is “Project Overview” and highlights “Key Highlights”, both rich text (below).
  • gallery holds three photos: the first two under the overview, the third wide under the highlights. Leave it empty ([]) and the page shows no photos there (the demo’s Makadam has none).
Field What it does
slug The URL: /product/<slug>
title The card’s and the page’s title (“Wedoes”); the browser title is the title and the tagline (“Wedoes - Framer Template for Digital Creative Agency”), the tagline’s last word dropped when the whole passes 60 characters
tagline Under the title, on the card and the page
price Text, shown on the card and in the page’s buy button (“Buy - $59”)
category Kept with the product; the site doesn’t show it
buyUrl Where the card’s cart button and the page’s buy button lead (a checkout page, in a new tab)
demoUrl Where “Live Demo” leads
image The card’s photo and the page’s main image
screenshots Two images under the main image
specification The paragraph beside the images, and the page’s search description
overview “Overview”, rich text (below)

The demo’s six products are templates by Marcframe, and their buy and demo links point to https://example.com: put your own products and links in their place.

Adding a post, service, testimonial, job, tool or profile

Section titled “Adding a post, service, testimonial, job, tool or profile”
Add Fields
Post slug, title, image (the card’s photo, 4 : 3, and the wide cover, both cropped), category (any words: posts with the same one are listed under each other as “See more posts”; the demo uses Product Design, UX/UI and Web Design), date ("2024-07-08", shown as “Jul 8, 2024”), body (rich text, below). The search description is the start of the first paragraph.
Service slug (an id), title, description (three lines at most from tablets up), price ("$3,000", shown as “Starting at $3,000 per project”: the sentence is priceLabel in home.json and services.json), url (the “More Details” button, in a new tab, and the badge of the projects of this service; the demo’s open contra.com) and images (the photos that roll beside the card; four in the demo)
Testimonial name (also its id: keep it unique), role ("CEO of EcoShop"), photo (round, 50 px), quote and rating (a whole number of stars, 1 to 5)
Job slug, title, company, period (any text: "January 2023 - June 2023"), url (the CV links the title to it) and description
Tool slug, title, category (under the title), url (the card opens it in a new tab), logo (a square image, shown 50 px) and description (kept with the tool; the site doesn’t show it)
Profile label (its name for screen readers, and its id), short (the two letters of the tile: "DB"), href and icon (an SVG of 26 px shown on the tile while the pointer is over it)

A new project, product or post gets its own page, and its entry in sitemap.xml, on the next build. Services, testimonials, jobs, tools and profiles have no pages.

Most lists take any number of items. A few blocks are laid out for a fixed number, so keep it:

Where How many
A project three photos in gallery, or none
A product two screenshots
A testimonial a rating of 1 to 5 (one star each)
About three photos in intro (portrait, detail, wide)

The lists on Home, the CV and the end of the item pages show a fixed number of items, set in the page copy (count, tabletCount, phoneCount, desktopCount) or in src/lib/content.ts (the other products and the related posts); the cards of the Home lists are laid out for those numbers.

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 the item as text stay as they are: a project’s service, the footer’s links, a link in the copy. Removing a service also removes its checkbox from the contact form.

src/content/schemas.ts is the reference: it lists every field and has 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 body, a project’s overview and highlights and a product’s overview are a list of blocks:

"body": [
{ "type": "heading", "level": 3, "text": "Why prototyping matters" },
{ "type": "paragraph", "text": "A paragraph with **bold** words and a `code` word." },
{ "type": "paragraph", "text": "First line\nSecond line" },
{ "type": "list", "items": [
[{ "type": "paragraph", "text": "**Speed:** test ideas before building them." }],
[{ "type": "paragraph", "text": "Second item" }]
] }
]

A heading has a level from 2 to 6 and takes the text style of that level (the demo’s posts use 3, the products 5). Text is plain apart from three marks: words between double asterisks are bold, words between backticks are marked as code (in the text’s own font), and \n starts a new line inside a paragraph. There are no links and no italics inside the text. Each list item is itself a list of blocks, so an item can hold a nested list; add "ordered": true to a list for numbers instead of bullets.

  1. Put the file in src/assets/images/.
  2. Refer to it in the content as /images/<file>.

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

Photos Demo size
The portrait of the Home hero 600 × 830 (shown 150 × 200)
Your avatar (person.avatar): the header’s logo and the CV 180 × 180 (shown round, 34 and 90 px)
About: the portrait, the detail photo and the wide photo 1100 × 1573, 800 × 1200 and 1100 × 1438 (the frames change shape with the screen)
A project’s image and its first two gallery photos 1440 × 1080 (4 : 3)
A project’s third gallery photo (the wide one) 2240 × 1680 (4 : 3)
A product’s image and screenshots 1200 × 814 (shown 510 × 346 on desktop)
A post’s image (the card’s photo and the wide cover) 1600 px wide, landscape or portrait (the card is 4 : 3; the cover is the column’s width and 300 to 400 px tall)
A service’s images 400 px wide, any height (shown 100 × 150; 100 × 180 on phones)
The cover of the Course page’s title band 2240 × 1260
The course banner on Home (course.image in home.json) 640 × 360
The newsletter photo (Blog) 1200 × 675
A testimonial’s photo 150 × 150 (shown round, 50 px)
A tool’s logo 100 × 100 (shown 50 px)

Logos and icons ship as they are: the client logos (client-1.svg … client-5.svg, sample logos, shown 25 px tall; give each one’s width at that height in clients.logos of projects.json), the social icons (social-*.svg) and the tool logos (tool-*.png, tool-unsplash.svg), which are their owners’ trademarks and name the tools of the demo’s workflow: keep the ones you use, and put your own tools’ logos in place of the others.

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, so keep the subject away from the edges. A content path that points to a missing file stops the build with its name.

Every image in the content is written as { "src": …, "alt": … }: alt is a short description for screen readers and search engines. Write one for each photo you change (an empty "alt": "" marks a photo as decoration). The avatar in the header and the social icons are decoration next to their names; client logos take the company’s name.

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

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

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.

Almost every word is content, including the forms’ messages (contactForm and newsletter.form) and the menu’s labels. The few interface words that never change per site live in the code:

  • the date formats of posts (“Jul 8, 2024”) and projects (“June 2024”) in src/lib/format.ts;
  • the “ - “ between a product’s title and tagline in its browser title, also in src/lib/format.ts;
  • the “-” between the city and its time in the footer, in src/components/site/Footer.astro;
  • 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 ("/contact") lead somewhere: click through the site once with npm run preview after big changes. See Going live for the rest of the checklist.