İçeriğe Atla
Mustafa Erbay
Tutorials · 8 min read · görüntülenme Türkçe oku
100%

Building a Modern Blog with Astro

How to build a fast, SEO-friendly, and high-performance blog with the Astro framework.

Building a Modern Blog with Astro — cover image

Astro is an ideal framework for content-focused websites. Thanks to its zero JavaScript by default approach, it delivers flawless performance.

Why Astro?

What sets Astro apart from other frameworks:

  1. Zero JS by default: Your pages are served as pure HTML
  2. Island Architecture: Only the interactive parts load JS
  3. Content Collections: Type-safe content management
  4. Multi-framework support: React, Vue, and Svelte can be used together

Project Setup

Creating a new Astro project is very simple:

npm create astro@latest my-blog
cd my-blog
npm install
npm run dev

Content Collections

One of Astro’s most powerful features is Content Collections:

// content.config.ts
import { defineCollection, z } from 'astro:content';
import { glob } from 'astro/loaders';

const blog = defineCollection({
  loader: glob({ pattern: '**/*.mdx', base: './src/content/blog' }),
  schema: z.object({
    title: z.string(),
    description: z.string(),
    publishDate: z.coerce.date(),
    tags: z.array(z.string()),
  }),
});

export const collections = { blog };

With this structure, all your content is validated at build time.

Deploying to Cloudflare Pages

To deploy your Astro project to Cloudflare Pages:

  1. Push to GitHub
  2. Create a new Pages project in the Cloudflare Dashboard
  3. Set the build command to npm run build
  4. Specify the build output directory as dist
# wrangler.toml
name = "my-blog"
pages_build_output_dir = "./dist"

SEO Optimization

The basic steps for SEO in Astro:

  • Meta tags: Title and description on every page
  • Open Graph: For social media sharing
  • Sitemap: Via the @astrojs/sitemap integration
  • RSS Feed: Automatic with @astrojs/rss
  • JSON-LD: Inform search engines via structured data

Astro makes it easy to apply the best practices of modern web development. It is an excellent choice for a fast, secure, and SEO-friendly blog.

Paylaş:

Bu yazı faydalı oldu mu?

Yükleniyor...

Bu yazı nasıldı?

ME

Mustafa Erbay

Sistem Mimarisi · Network Uzmanı · Altyapı, Güvenlik ve Yazılım

2006'dan bu yana sistem mimarisi, network, sunucu altyapıları, büyük yapıların kurulumu, yazılım ve sistem güvenliği ekseninde çalışıyorum. Bu blogda sahada karşılığı olan teknik deneyimlerimi paylaşıyorum.

Kişisel Notlar

Bu notlar sadece sizde saklanır. Tarayıcınızda yerel olarak tutulur.

Hazır 0 karakter

Comments

Server-side AI Moderation

Comments are AI-moderated server-side and stored permanently.

?
0/2000

Server-side AI moderation

✉️ Free · No spam · Unsubscribe anytime

Curated digest, hand-picked by me — not the AI

Once a week: the most important post of the week, behind-the-scenes notes, and a "what I actually used this week" section. Less noise, more signal.

  • 📌
    Best of the week Single most-worth-reading post
  • 🔧
    Toolbox notes Real tools I used this week
  • 🧠
    Behind-the-scenes Notes that don't make it to blog

We don't spam. Unsubscribe anytime. · Tracked only by Umami (self-hosted, no Google).

Your Reading Stats

0

Posts Read

0m

Reading Time

0

Day Streak

-

Favorite Category

Related Posts