To build a travel blog with Astro, write posts in Markdown or MDX, store destinations as their own content collection, link each post to a destination with reference(), generate country and trip pages with getStaticPaths(), and serve photos through astro:assets so they’re resized and compressed at build time. A travel blog built with Astro loads quickly on slow hotel Wi-Fi and mobile data, which matters when your readers are often on the road themselves.
This guide walks through the content model, the pages, photo handling and the extras that make a travel blog useful to readers.
Key Takeaways
- Model destinations separately from posts so every country or city gets its own landing page.
- Use the
image()schema helper for cover photos and<Image />withwidthsandsizesfor every photo in a post.- Photo galleries need no JavaScript to look good. Add a lightbox only if you want one.
- Avoid heavy embedded maps on every page. A static map image or a map loaded on click is far lighter.
- Add an RSS feed and a newsletter form so readers come back after their trip planning is done.
How a travel blog is different from a regular blog
A general blog is a list of posts by date. Travel readers rarely browse by date. They arrive from a search like “3 days in Lisbon” or “Japan rail pass worth it,” read one post, and then want everything else you’ve written about that place.
So the structure that works is destination-first:
| Page | Purpose |
|---|---|
| Home | Latest posts, featured destinations, who you are |
| Destination | All posts for a country or city, plus a short overview |
| Post | The guide or story itself, with photos and practical details |
| Trip | A multi-stop itinerary that links posts in travel order |
| Map | Optional page showing everywhere you’ve written about |
| About | Your travel style, budget level, how you fund the blog |
The “about” page matters more than on most blogs. Readers decide whether your advice fits them based on how you travel: backpacker or luxury, solo or family, fast or slow.
Start the project
# Terminal
npm create astro@latest travel-blog
cd travel-blog
npx astro add mdx sitemap
npm install @astrojs/rss
npm run dev
MDX lets you drop components like galleries and tip boxes into posts. Set site in astro.config.mjs to your domain so the sitemap and RSS feed get absolute URLs.
Model destinations and posts
Two collections linked by reference. A post belongs to one destination, and the destination knows its country and region for grouping.
// src/content.config.ts
import { defineCollection, reference } from 'astro:content';
import { glob } from 'astro/loaders';
import { z } from 'astro/zod';
const destinations = defineCollection({
loader: glob({ pattern: '*.md', base: './src/content/destinations' }),
schema: ({ image }) =>
z.object({
name: z.string(),
country: z.string(),
region: z.enum(['europe', 'asia', 'americas', 'africa', 'oceania']),
cover: image(),
lat: z.number(),
lng: z.number(),
}),
});
const posts = defineCollection({
loader: glob({ pattern: '**/index.{md,mdx}', base: './src/content/posts' }),
schema: ({ image }) =>
z.object({
title: z.string(),
description: z.string().max(160),
pubDate: z.coerce.date(),
updatedDate: z.coerce.date().optional(),
destination: reference('destinations'),
trip: z.string().optional(),
cover: image(),
coverAlt: z.string(),
tags: z.array(z.string()).default([]),
}),
});
export const collections = { destinations, posts };
updatedDate matters for travel content. Prices, opening hours and visa rules change, and readers trust posts that show when they were last checked. Display it near the top of the post.
A post file looks like this:
<!-- src/content/posts/lisbon-three-days/index.mdx -->
---
title: "Three days in Lisbon on a mid-range budget"
description: "A three-day Lisbon itinerary with neighborhoods, food, day trips and real costs."
pubDate: 2026-09-12
destination: lisbon
trip: "portugal-2026"
cover: "./tram.jpg"
coverAlt: "Yellow tram climbing a narrow street in Alfama"
tags: ["itinerary", "city break"]
---
The destination: lisbon value must match a file named lisbon.md in the destinations folder, or the build fails. That’s the point: no orphan posts with misspelled place names.
Build destination pages
Each destination gets a page listing every post about it. These pages tend to rank well because they’re the natural answer to “travel guide to X.”
---
// src/pages/destinations/[id].astro
import { getCollection, render } from 'astro:content';
import { Image } from 'astro:assets';
import Base from '../../layouts/Base.astro';
import PostCard from '../../components/PostCard.astro';
export async function getStaticPaths() {
const destinations = await getCollection('destinations');
return destinations.map((destination) => ({
params: { id: destination.id },
props: { destination },
}));
}
const { destination } = Astro.props;
const { Content } = await render(destination);
const posts = (
await getCollection('posts', ({ data }) => data.destination.id === destination.id)
).sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime());
---
<Base
title={`${destination.data.name} travel guide`}
description={`Every guide and story about ${destination.data.name}, ${destination.data.country}.`}
>
<Image src={destination.data.cover} alt={destination.data.name} widths={[800, 1600]} sizes="100vw" loading="eager" />
<h1>{destination.data.name} travel guide</h1>
<Content />
<h2>Posts about {destination.data.name}</h2>
{posts.map((post) => <PostCard post={post} />)}
</Base>
Write a real overview in each destination’s Markdown body: best time to visit, how to get there, how many days you need. A list of links alone is a thin page. The same getStaticPaths() pattern builds country pages (group destinations by country) and tag pages; see tags and categories pages in Astro for that pattern.
Handle travel photos without slowing the blog
Photos are the heaviest part of any travel blog. Astro’s image pipeline does most of the work if you keep photos inside src/ so they’re processed at build time.
---
// src/components/Gallery.astro
import { Image } from 'astro:assets';
import type { ImageMetadata } from 'astro';
interface Props {
photos: { src: ImageMetadata; alt: string }[];
}
const { photos } = Astro.props;
---
<div class="gallery">
{photos.map((photo) => (
<a href={photo.src.src}>
<Image src={photo.src} alt={photo.alt} widths={[400, 800]} sizes="(min-width: 768px) 33vw, 100vw" />
</a>
))}
</div>
<style>
.gallery {
display: grid;
gap: 0.5rem;
grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}
.gallery img {
width: 100%;
height: 100%;
object-fit: cover;
aspect-ratio: 4 / 3;
}
</style>
Use it in an MDX post by importing the photos:
{/* src/content/posts/lisbon-three-days/index.mdx */}
import Gallery from '../../../components/Gallery.astro';
import alfama from './alfama.jpg';
import belem from './belem.jpg';
import sintra from './sintra.jpg';
<Gallery photos={[
{ src: alfama, alt: 'Rooftops of Alfama at sunset' },
{ src: belem, alt: 'Belem Tower from the riverside' },
{ src: sintra, alt: 'Pena Palace above the forest in Sintra' },
]} />
Each thumbnail links to the full-size optimized file, which works as a basic viewer with zero JavaScript. If you want a proper lightbox with swipe, the Astro image lightbox tip shows a small one. Rules worth following:
- Resize phone and camera photos to about 2,400 pixels on the long edge before committing. Twelve-megapixel originals bloat your repository and slow builds.
- Write real
alttext describing the scene. It helps image search, which sends a lot of travel traffic. - Strip GPS metadata from photos of places you stay, such as rentals or homes you were invited into. Astro’s processed images drop metadata, but the originals in your repo still have it.
The Astro images guide covers formats, remote images and the <Picture /> component.
Add a map without the weight
An embedded interactive map can add hundreds of kilobytes of JavaScript per page. For a travel blog, three lighter options work:
- Static map image on each destination page, linked to the location in a maps app. Zero JavaScript.
- Map on click: show a placeholder image and load the map library only when the reader clicks “Show map.”
- One map page: a single
/map/page with an interactive map of every destination, using thelatandlngfields from your collection, hydrated withclient:visibleso it loads only when scrolled into view.
Option 3 keeps the heavy code on one page instead of every post. Pass the destination data from the frontmatter into your map component as props, and Astro serializes it for the island.
Practical details readers want
The posts that earn bookmarks and backlinks have the boring details: costs, transport, how long things take. Add a consistent “practical info” box to each post with an MDX component, or extend the schema with optional fields like budgetPerDay, bestMonths and daysNeeded and render them in the layout. Structured fields also let you build pages like “budget destinations” automatically.
If you use affiliate links for hotels or tours, mark them with rel="sponsored" and disclose them in plain words near the top of the post. Readers and search engines both expect it.
RSS, newsletter and search
Travel readers often plan months ahead, then disappear. An RSS feed and a newsletter bring them back:
// src/pages/rss.xml.ts
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
import type { APIContext } from 'astro';
export async function GET(context: APIContext) {
const posts = await getCollection('posts');
return rss({
title: 'Slow Roads',
description: 'Travel guides and stories from slow, mid-range trips.',
site: context.site!,
items: posts.map((post) => ({
title: post.data.title,
description: post.data.description,
pubDate: post.data.pubDate,
link: `/posts/${post.id}/`,
})),
});
}
The Astro RSS feed guide adds full content and images to the feed. For on-site search across hundreds of posts, Pagefind indexes the built HTML and runs entirely in the browser, with no search server.
Deploy the travel blog
Run npm run build and deploy dist/ to Cloudflare Pages, Netlify, Vercel or GitHub Pages. Image-heavy blogs can take longer to build because every photo is processed. Astro caches processed images between builds in node_modules/.astro, so enable your host’s build cache to keep rebuilds fast.
Start from a theme
Free options worth a look: AstroPaper is a clean, fast blog template with tags and search that you can adapt with the destination collection above, and Astro’s official blog starter (npm create astro@latest -- --template blog) is a minimal base. If you’d rather start from a travel-flavored design, Komal themes include AirExploreX, built for travel bloggers and tour operators with destination and blog pages, Bali Travels for travel agencies and bloggers, and BlogMin, a minimal blog, lifestyle and travel theme. The Blog & Editorial category has more writing-first designs. For the general blog setup, see how to build a blog with Astro.
FAQ
Is Astro good for a travel blog?
Yes. Travel blogs are content-heavy and photo-heavy, and Astro handles both well: Markdown or MDX posts, build-time image optimization, and pages that ship almost no JavaScript. That keeps the blog fast for readers on mobile data abroad.
How do I organize a travel blog by country in Astro?
Create a destinations collection with a country field, reference a destination from each post, and use getStaticPaths() to generate one page per country that lists its destinations and posts.
How do I add lots of photos to an Astro travel blog without slowing it down?
Keep photos in src/ so Astro optimizes them, use <Image /> with widths and sizes for responsive files, rely on the default lazy loading below the fold, and resize originals before committing them.
Can I add a map to an Astro blog?
Yes. Use a static map image for most pages, and put an interactive map on a single page as an island with client:visible so its JavaScript only loads when the reader scrolls to it.
Can I monetize an Astro travel blog?
Yes. Affiliate links, display ads and sponsored posts all work on a static Astro site. Mark affiliate and sponsored links with rel="sponsored", disclose them clearly, and load ad scripts carefully, since they affect page speed more than anything else on the page.