๐Ÿš€

Astro ์น˜ํŠธ์‹œํŠธ

Astro 5.x/4.x ์ตœ์‹  ์™„์ „ ๊ฐ€์ด๋“œ: ์•„์ผ๋žœ๋“œ ์•„ํ‚คํ…์ฒ˜(Islands), ์ œ๋กœ JS(Zero-JS) ๊ธฐ๋ณธ ๋ Œ๋”๋ง, ํด๋ผ์ด์–ธํŠธ ๋””๋ ‰ํ‹ฐ๋ธŒ(client:load/visible), ์ปดํฌ๋„ŒํŠธ ํ”„๋ก ํŠธ๋งคํ„ฐ ๋ฌธ๋ฒ•, ํŒŒ์ผ ๊ธฐ๋ฐ˜ ๋™์  ๋ผ์šฐํŒ…(getStaticPaths), Content Collections(ํƒ€์ž… ์•ˆ์ „ ์Šคํ‚ค๋งˆ), ViewTransitions(ClientRouter) ์• ๋‹ˆ๋ฉ”์ด์…˜ ๋ฐ SSR ํ•˜์ด๋ธŒ๋ฆฌ๋“œ ์–ด๋Œ‘ํ„ฐ ๋ฐฐํฌ

--views
๋‹จ์ˆ˜:
#astro#islands-architecture#ssg#ssr#zero-js#frontend#web-framework#typescript#content-collections#view-transitions์ตœ์ข… ์—…๋ฐ์ดํŠธ: 2026-10-10

1. ํ•„์ˆ˜ ์‚ฌ์ „ ์š”๊ฑด & ์‹œ์Šคํ…œ ์š”๊ตฌ์‚ฌ์–‘ (Prerequisites & Setup)

๐Ÿ’ป ์‹œ์Šคํ…œ ์„ค์น˜ ๋ฐ ์‹คํ–‰ ์š”๊ตฌ์‚ฌ์–‘ (System Requirements)

ํ•ญ๋ชฉ์ตœ์†Œ ์‚ฌ์–‘ (Minimum)๊ถŒ์žฅ ์‚ฌ์–‘ (Recommended)์ฐธ๊ณ  ๋ฐ ๋น„๊ณ 
์šด์˜์ฒด์ œ (OS)Windows 10/11, macOS, LinuxmacOS Sonoma, Ubuntu 22.04 LTS+, Windows 11 (WSL2)Vite ๊ธฐ๋ฐ˜ ๊ณ ์„ฑ๋Šฅ ES ๋ชจ๋“ˆ ๋นŒ๋“œ ํ™˜๊ฒฝ
CPU2 ์ฝ”์–ด ์ด์ƒ4 ์ฝ”์–ด ~ 8 ์ฝ”์–ด ์ด์ƒ๋Œ€๊ทœ๋ชจ ๋งˆํฌ๋‹ค์šด/MDX ํŒŒ์‹ฑ ๋ฐ ์ด๋ฏธ์ง€ ์ตœ์ ํ™” ํŒŒ์ดํ”„๋ผ์ธ
๋ฉ”๋ชจ๋ฆฌ (RAM)2 GB ์ด์ƒ4 GB ~ 8 GB ์ด์ƒNode.js ๋Ÿฐํƒ€์ž„ ๋ฐ ์ƒคํ”„(Sharp) ์ด๋ฏธ์ง€ ๋ฆฌ์‚ฌ์ด์ง• ์บ์‹œ
๋””์Šคํฌ (Storage)500 MB ์ด์ƒ์˜ ์—ฌ์œ  ๊ณต๊ฐ„5 GB ~ 20 GB ์ด์ƒ์˜ ๊ณ ์† NVMe SSDnode_modules ๋ฐ .astro ๋นŒ๋“œ ์บ์‹œ ๋ณด๊ด€
๋Ÿฐํƒ€์ž„ / ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ €Node.js 18.17.1+ ๋˜๋Š” 20+ (LTS)Node.js 22 LTS / pnpm 9+ / Bun 1.1+pnpm ๋˜๋Š” bun ์‚ฌ์šฉ ์‹œ ํŒจํ‚ค์ง€ ์„ค์น˜ ์†๋„ 3~5๋ฐฐ ํ–ฅ์ƒ

๐Ÿš€ ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ & ๋””๋ ‰ํ† ๋ฆฌ ๊ตฌ์กฐ

# [1] ๊ณต์‹ ๋Œ€ํ™”ํ˜• CLI๋กœ ์ตœ์‹  Astro ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ
npm create astro@latest my-astro-site
# ๋˜๋Š” pnpm / bun ์‚ฌ์šฉ
pnpm create astro@latest my-astro-site

# [2] ํ”„๋กœ์ ํŠธ ๋””๋ ‰ํ† ๋ฆฌ ์ด๋™ ๋ฐ ๊ฐœ๋ฐœ ์„œ๋ฒ„ ์‹คํ–‰
cd my-astro-site
npm install
npm run dev

# [3] ๊ณต์‹ ํ†ตํ•ฉ ํ”Œ๋Ÿฌ๊ทธ์ธ 1์ดˆ ์ž๋™ ์ถ”๊ฐ€ (React, Tailwind, Sitemap ๋“ฑ)
npx astro add react
npx astro add tailwind
npx astro add sitemap

๐Ÿ“ ํ‘œ์ค€ ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ (Standard Architecture)

my-astro-site/
โ”œโ”€โ”€ public/                 # ๋นŒ๋“œ ์‹œ ๊ทธ๋Œ€๋กœ ๋ณต์‚ฌ๋˜๋Š” ์ •์  ์—์…‹ (favicon, robots.txt)
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/         # ์žฌ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ UI ์ปดํฌ๋„ŒํŠธ (.astro, .jsx, .vue)
โ”‚   โ”œโ”€โ”€ layouts/            # ๊ณตํ†ต ํŽ˜์ด์ง€ ๋ผˆ๋Œ€ ๋ ˆ์ด์•„์›ƒ (BaseLayout.astro)
โ”‚   โ”œโ”€โ”€ pages/              # ํŒŒ์ผ ๊ธฐ๋ฐ˜ ๋ผ์šฐํŒ… ๋””๋ ‰ํ† ๋ฆฌ (HTML ๋ฐ API ์—”๋“œํฌ์ธํŠธ)
โ”‚   โ”‚   โ”œโ”€โ”€ index.astro     # ๋ฃจํŠธ ํŽ˜์ด์ง€ (/)
โ”‚   โ”‚   โ”œโ”€โ”€ about.astro     # /about ํŽ˜์ด์ง€
โ”‚   โ”‚   โ””โ”€โ”€ posts/
โ”‚   โ”‚       โ””โ”€โ”€ [id].astro  # ๋™์  ๋ผ์šฐํŠธ (/posts/1, /posts/2)
โ”‚   โ”œโ”€โ”€ content/            # ํƒ€์ž… ์•ˆ์ „ ๋งˆํฌ๋‹ค์šด/MDX ์ฝ˜ํ…์ธ  ์ปฌ๋ ‰์…˜
โ”‚   โ”‚   โ””โ”€โ”€ blog/
โ”‚   โ””โ”€โ”€ content.config.ts   # Astro 5+ ์ฝ˜ํ…์ธ  ์Šคํ‚ค๋งˆ ์ •์˜ ํŒŒ์ผ
โ”œโ”€โ”€ astro.config.mjs        # Astro ์ „์—ญ ํ™˜๊ฒฝ ์„ค์ • ํŒŒ์ผ (Vite, ์–ด๋Œ‘ํ„ฐ, ํ”Œ๋Ÿฌ๊ทธ์ธ)
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ tsconfig.json           # strict ๋ชจ๋“œ๊ฐ€ ๊ธฐ๋ณธ ํ™œ์„ฑํ™”๋œ ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ์„ค์ •

2. Astro ํ•ต์‹ฌ ๋ฉ˜ํƒˆ ๋ชจ๋ธ: ์•„์ผ๋žœ๋“œ ์•„ํ‚คํ…์ฒ˜ (Islands Architecture)

Astro๋Š” ์ฝ˜ํ…์ธ  ์ค‘์‹ฌ(Content-Driven) ์›น์‚ฌ์ดํŠธ๋ฅผ ์œ„ํ•ด ํƒœ์–ด๋‚ฌ์œผ๋ฉฐ, ๊ธฐ๋ณธ์ ์œผ๋กœ ํด๋ผ์ด์–ธํŠธ๋กœ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ๋‹จ 1๋ฐ”์ดํŠธ๋„ ์ „์†กํ•˜์ง€ ์•Š๋Š” ์ œ๋กœ JS(Zero JavaScript by Default) ์ฒ ํ•™์„ ๊ฐ€์ง‘๋‹ˆ๋‹ค.

๐Ÿ“ SPA vs ์•„์ผ๋žœ๋“œ ์•„ํ‚คํ…์ฒ˜ ๋น„๊ต ๋‹ค์ด์–ด๊ทธ๋žจ (ASCII Diagram)

[ ์ „ํ†ต์ ์ธ React / Vue SPA ]
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  ๊ฑฐ๋Œ€ํ•œ ๋‹จ์ผ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ๋ฒˆ๋“ค (Heavy JS Bundle: 500KB+)  โ”‚
โ”‚  ์ „์ฒด ํŽ˜์ด์ง€๊ฐ€ ์ˆ˜ํ™”(Hydration)๋˜๊ธฐ ์ „๊นŒ์ง€ ์‚ฌ์šฉ์ž ์ธํ„ฐ๋ž™์…˜ ์ฐจ๋‹จ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

[ Astro Islands (์•„์ผ๋žœ๋“œ ์•„ํ‚คํ…์ฒ˜) ]
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Pure HTML / Scoped CSS (์ •์  ๋งˆํฌ์—… - Zero JS, ์ดˆ๊ณ ์† ๋กœ๋”ฉ)โ”‚
โ”‚                                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ Interactive Header    โ”‚      โ”‚ Image Carousel      โ”‚  โ”‚
โ”‚  โ”‚ [client:load]         โ”‚      โ”‚ [client:visible]    โ”‚  โ”‚
โ”‚  โ”‚ (React ์„ฌ: ์ฆ‰์‹œ ์ˆ˜ํ™”)  โ”‚      โ”‚ (Vue ์„ฌ: ์Šคํฌ๋กค ๋„๋‹ฌ ์‹œโ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                                          โ”‚
โ”‚  ์ˆœ์ˆ˜ ์ •์  ๋ณธ๋ฌธ ๊ธ€ / ํ…์ŠคํŠธ / ํ‘ธํ„ฐ (HTML๋งŒ ๋ Œ๋”๋ง, JS ์—†์Œ)โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โšก 5๋Œ€ ํด๋ผ์ด์–ธํŠธ ๋””๋ ‰ํ‹ฐ๋ธŒ (Client Directives) ์ˆ˜ํ™” ์ „๋žต

Astro ์ปดํฌ๋„ŒํŠธ ๋‚ด๋ถ€์—์„œ React/Vue/Svelte ์ปดํฌ๋„ŒํŠธ๋ฅผ ํ˜ธ์ถœํ•  ๋•Œ, ์–ธ์ œ ๋ธŒ๋ผ์šฐ์ €์—์„œ JS๋ฅผ ๋กœ๋“œํ• ์ง€ ๊ฒฐ์ •ํ•ฉ๋‹ˆ๋‹ค:

๋””๋ ‰ํ‹ฐ๋ธŒ๋™์ž‘ ์‹œ์  ๋ฐ ์ˆ˜ํ™” ํƒ€์ด๋ฐ๊ถŒ์žฅ ์‹ค๋ฌด ์‹œ๋‚˜๋ฆฌ์˜ค
client:loadํŽ˜์ด์ง€ ๋กœ๋“œ ์ฆ‰์‹œ ์šฐ์„ ์ˆœ์œ„๋กœ JS ๋‹ค์šด๋กœ๋“œ ๋ฐ ์ˆ˜ํ™”์ƒ๋‹จ ๊ธ€๋กœ๋ฒŒ ๋„ค๋น„๊ฒŒ์ด์…˜(GNB), ๊ฒ€์ƒ‰์ฐฝ, ๋‹คํฌ๋ชจ๋“œ ํ† ๊ธ€
client:idleํŽ˜์ด์ง€ ์ดˆ๊ธฐ ๋กœ๋”ฉ ์™„๋ฃŒ ํ›„ ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ์œ ํœด(Idle) ์ƒํƒœ์ผ ๋•Œ ๋กœ๋“œ์ฑ—๋ด‡ ์œ„์ ฏ, ๋Œ“๊ธ€ ์ž…๋ ฅ์ฐฝ, ์•Œ๋ฆผ ๋ฐฐ์ง€
client:visible์‚ฌ์šฉ์ž๊ฐ€ ์Šคํฌ๋กคํ•˜์—ฌ ํ•ด๋‹น ์ปดํฌ๋„ŒํŠธ๊ฐ€ ํ™”๋ฉด(Viewport)์— ๋‚˜ํƒ€๋‚  ๋•Œํ•˜๋‹จ ์ถ”์ฒœ ์ƒํ’ˆ ์บ๋Ÿฌ์…€, ๋ณต์žกํ•œ ๋ฐ์ดํ„ฐ ์ฐจํŠธ, ๋ฌดํ•œ ์Šคํฌ๋กค
client:media="(query)"์ง€์ •ํ•œ CSS ๋ฏธ๋””์–ด ์ฟผ๋ฆฌ๊ฐ€ ์ผ์น˜ํ•  ๋•Œ๋งŒ ๋กœ๋“œ๋ชจ๋ฐ”์ผ ํ–„๋ฒ„๊ฑฐ ์Šฌ๋ผ์ด๋“œ ๋ฉ”๋‰ด (client:media="(max-width: 768px)")
client:only="react"์„œ๋ฒ„ ๋ Œ๋”๋ง(SSR)์„ ์™„์ „ํžˆ ๊ฑด๋„ˆ๋›ฐ๊ณ  ํด๋ผ์ด์–ธํŠธ์—์„œ๋งŒ ๋ Œ๋”๋ง๋ธŒ๋ผ์šฐ์ € ์ „์šฉ API(window, localStorage, Canvas) ์˜์กด UI

3. [์ดˆ๋ณด์ž 1๋‹จ๊ณ„] 3๋ถ„ ํ—ฌ๋กœ์›”๋“œ: ์ปดํฌ๋„ŒํŠธ & ๋ ˆ์ด์•„์›ƒ ์‹ค์Šต (Hello World)

Astro ์ปดํฌ๋„ŒํŠธ๋Š” ํฌ๊ฒŒ ์ƒ๋‹จ ์ฝ”๋“œ ํŽœ์Šค(---) ์‚ฌ์ด์˜ **์„œ๋ฒ„ ์ปดํฌ๋„ŒํŠธ ์Šคํฌ๋ฆฝํŠธ(Frontmatter)**์™€ ํ•˜๋‹จ์˜ HTML ํ…œํ”Œ๋ฆฟ ๋งˆํฌ์—…์œผ๋กœ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค.

โ‘  ๊ณตํ†ต ๋ฒ ์ด์Šค ๋ ˆ์ด์•„์›ƒ (src/layouts/BaseLayout.astro)

---
// src/layouts/BaseLayout.astro
interface Props {
  title: string;
  description?: string;
}

const { title, description = 'Astro๋กœ ์ œ์ž‘๋œ ์ดˆ๊ณ ์† ๋ชจ๋˜ ์›น์‚ฌ์ดํŠธ' } = Astro.props;
---

<!doctype html>
<html lang="ko">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>{title}</title>
    <meta name="description" content={description} />
    <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
  </head>
  <body>
    <header class="site-header">
      <nav class="nav-container">
        <a href="/" class="brand-logo">๐Ÿš€ Lucky Astro</a>
        <div class="nav-links">
          <a href="/">ํ™ˆ</a>
          <a href="/about">์†Œ๊ฐœ</a>
        </div>
      </nav>
    </header>

    <main class="site-main">
      <!-- ํŽ˜์ด์ง€๋ณ„ ๋ณธ๋ฌธ ์ฝ˜ํ…์ธ ๊ฐ€ ์ฃผ์ž…๋˜๋Š” ์Šฌ๋กฏ -->
      <slot />
    </main>

    <footer class="site-footer">
      <p>ยฉ 2026 LuckyTechWorld. All rights reserved.</p>
    </footer>
  </body>
</html>

<style>
  /* ์ปดํฌ๋„ŒํŠธ ๋‚ด๋ถ€์— ์ž๋™ ์Šค์ฝ”ํ”„(Scoped)๋˜๋Š” CSS */
  body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    background: #0f172a;
    color: #f8fafc;
  }
  .nav-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .brand-logo {
    color: #38bdf8;
    font-weight: 700;
    text-decoration: none;
    font-size: 1.25rem;
  }
  .nav-links a {
    color: #94a3b8;
    text-decoration: none;
    margin-left: 1rem;
  }
  .nav-links a:hover {
    color: #ffffff;
  }
  .site-main {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1.5rem;
  }
  .site-footer {
    text-align: center;
    padding: 2rem 0;
    color: #64748b;
    border-top: 1px solid #1e293b;
  }
</style>

โ‘ก ์žฌ์‚ฌ์šฉ ์นด๋“œ ์ปดํฌ๋„ŒํŠธ (src/components/TechCard.astro)

---
// src/components/TechCard.astro
interface Props {
  name: string;
  category: string;
  stars: number;
}

const { name, category, stars } = Astro.props;
---

<div class="tech-card">
  <span class="category-badge">{category}</span>
  <h3 class="tech-name">{name}</h3>
  <div class="card-footer">
    <span class="stars">โญ {stars.toLocaleString()}</span>
    <!-- ์ถ”๊ฐ€ ์ปค์Šคํ…€ ์Šฌ๋กฏ ์ง€์› -->
    <slot />
  </div>
</div>

<style>
  .tech-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 1.25rem;
    transition: transform 0.2s, border-color 0.2s;
  }
  .tech-card:hover {
    transform: translateY(-4px);
    border-color: #38bdf8;
  }
  .category-badge {
    font-size: 0.75rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
  }
  .tech-name {
    margin: 0.75rem 0;
    font-size: 1.25rem;
  }
  .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #94a3b8;
  }
</style>

โ‘ข ๋ฉ”์ธ ํ™ˆ ํŽ˜์ด์ง€ (src/pages/index.astro)

---
// src/pages/index.astro
import BaseLayout from '../layouts/BaseLayout.astro';
import TechCard from '../components/TechCard.astro';

// ํ”„๋ก ํŠธ๋งคํ„ฐ: ์„œ๋ฒ„ ๋นŒ๋“œ ์‹œ์ ์— ์‹คํ–‰๋˜๋Š” ์ˆœ์ˆ˜ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ/ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ
const pageTitle = "Astro ๊ธฐ์ˆ  ์Šคํƒ ๋Œ€์‹œ๋ณด๋“œ";
const techList = [
  { name: "Astro 5", category: "Web Framework", stars: 46000 },
  { name: "React 19", category: "UI Library", stars: 220000 },
  { name: "Tailwind CSS", category: "Styling", stars: 81000 },
];
---

<BaseLayout title={pageTitle}>
  <section class="hero-section">
    <h1>ํ™˜์˜ํ•ฉ๋‹ˆ๋‹ค! <span class="highlight">Astro ์„ธ์ƒ์— ์˜ค์‹  ๊ฒƒ์„</span></h1>
    <p>์„œ๋ฒ„ ๋นŒ๋“œ ์‹œ์ ์— ๋ Œ๋”๋ง๋˜์–ด ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ๋ถ€๋‹ด ์—†์ด ๋ฒˆ๊ฐœ์ฒ˜๋Ÿผ ๋น ๋ฆ…๋‹ˆ๋‹ค.</p>
  </section>

  <section class="card-grid">
    {techList.map((tech) => (
      <TechCard name={tech.name} category={tech.category} stars={tech.stars}>
        <span class="status-dot">์ •์ƒ ์ž‘๋™</span>
      </TechCard>
    ))}
  </section>
</BaseLayout>

<style>
  .hero-section {
    text-align: center;
    margin-bottom: 3rem;
  }
  .highlight {
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
  }
  .status-dot {
    color: #10b981;
    font-weight: 600;
    font-size: 0.8rem;
  }
</style>

4. [2๋‹จ๊ณ„] ํ•ต์‹ฌ ๊ธฐ๋Šฅ: ํŒŒ์ผ ๊ธฐ๋ฐ˜ ๋ผ์šฐํŒ… & ๋™์  ๋ผ์šฐํŠธ (Routing)

Astro๋Š” src/pages/ ๋””๋ ‰ํ† ๋ฆฌ ํ•˜์œ„์˜ ํŒŒ์ผ ๊ฒฝ๋กœ๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ ์›น URL์„ ์ž๋™ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

๐ŸŒ ๋ผ์šฐํŒ… ๊ทœ์น™ ๋งคํ•‘

ํŒŒ์ผ ๊ฒฝ๋กœ๋ธŒ๋ผ์šฐ์ € ์š”์ฒญ URL์œ ํ˜•
src/pages/index.astro/๋ฃจํŠธ ํ™ˆ ํŽ˜์ด์ง€
src/pages/about.astro/about๋‹จ์ผ ์ •์  ํŽ˜์ด์ง€
src/pages/blog/index.astro/blog๋ธ”๋กœ๊ทธ ๋ชฉ๋ก ํŽ˜์ด์ง€
src/pages/blog/[slug].astro/blog/hello-world์ •์ /๋™์  ํŒŒ๋ผ๋ฏธํ„ฐ ๋ผ์šฐํŠธ
src/pages/docs/[...slug].astro/docs/guide/install์ „์—ญ ์ผ์น˜(Catch-all) ๋ผ์šฐํŠธ
src/pages/404.astro(์ผ์น˜ํ•˜์ง€ ์•Š๋Š” ๋ชจ๋“  URL)์ปค์Šคํ…€ 404 ์—๋Ÿฌ ํŽ˜์ด์ง€

๐Ÿ“„ ์ •์  ์‚ฌ์ดํŠธ ๋™์  ๋ผ์šฐํŠธ (src/pages/posts/[id].astro)

๊ธฐ๋ณธ ์ •์  ๋ชจ๋“œ(SSG)์—์„œ๋Š” getStaticPaths() ํ•จ์ˆ˜๋ฅผ ๋ฐ˜๋“œ์‹œ exportํ•˜์—ฌ ๋นŒ๋“œํ•  ํŽ˜์ด์ง€ ๋ชฉ๋ก(params ๋ฐ props)์„ ์‚ฌ์ „์— ์ •์˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

---
// src/pages/posts/[id].astro
import BaseLayout from '../../layouts/BaseLayout.astro';

// [1] ๋นŒ๋“œ ์‹œ์ ์— ์ƒ์„ฑํ•  ๋ชจ๋“  ๊ฒฝ๋กœ(Paths) ๋ฐ˜ํ™˜
export async function getStaticPaths() {
  // ์‹ค์ œ ํ™˜๊ฒฝ์—์„œ๋Š” ์™ธ๋ถ€ CMS๋‚˜ DB, Markdown ์ปฌ๋ ‰์…˜์—์„œ ์กฐํšŒ
  const posts = [
    { id: '1', title: 'Astro ์•„์ผ๋žœ๋“œ์˜ ๋น„๋ฐ€', content: '์•„์ผ๋žœ๋“œ๋Š” ํ•„์š”ํ•œ ๋ถ€๋ถ„๋งŒ ์ˆ˜ํ™”ํ•ฉ๋‹ˆ๋‹ค.' },
    { id: '2', title: 'Content Collections ์™„๋ฒฝ ๊ฐ€์ด๋“œ', content: 'Zod ์Šคํ‚ค๋งˆ๋กœ ํƒ€์ž…์„ ์—„๊ฒฉํžˆ ๊ฒ€์ฆํ•ฉ๋‹ˆ๋‹ค.' },
    { id: '3', title: 'Astro 5 ์‹ ๊ธฐ๋Šฅ ์ด์ •๋ฆฌ', content: '์ƒˆ๋กœ์šด Content Layer API๊ฐ€ ๋„์ž…๋˜์—ˆ์Šต๋‹ˆ๋‹ค.' },
  ];

  return posts.map((post) => ({
    params: { id: post.id },
    props: { post },
  }));
}

// [2] ํ˜„์žฌ ์š”์ฒญ๋œ ํŒŒ๋ผ๋ฏธํ„ฐ ๋ฐ props ์ˆ˜์‹ 
const { id } = Astro.params;
const { post } = Astro.props;
---

<BaseLayout title={`${post.title} - ๊ฒŒ์‹œ๊ธ€ #${id}`}>
  <article class="post-detail">
    <a href="/" class="back-link">โ† ๋ชฉ๋ก์œผ๋กœ ๋Œ์•„๊ฐ€๊ธฐ</a>
    <h1 class="post-title">{post.title}</h1>
    <div class="post-meta">๊ฒŒ์‹œ๊ธ€ ID: <code>{id}</code></div>
    <div class="post-body">
      <p>{post.content}</p>
    </div>
  </article>
</BaseLayout>

<style>
  .post-detail {
    background: #1e293b;
    padding: 2rem;
    border-radius: 12px;
  }
  .back-link {
    color: #38bdf8;
    text-decoration: none;
    font-size: 0.9rem;
  }
  .post-title {
    margin: 1rem 0;
  }
  .post-meta {
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
  }
</style>

5. [2๋‹จ๊ณ„] Content Collections: ํƒ€์ž… ์•ˆ์ „ ์ฝ˜ํ…์ธ  ๊ด€๋ฆฌ (Content Collections)

Astro 5+์—์„œ๋Š” ๋”์šฑ ๊ฐ•๋ ฅํ•ด์ง„ Content Layer API๋ฅผ ํ†ตํ•ด ๋กœ์ปฌ ๋งˆํฌ๋‹ค์šด๋ฟ ์•„๋‹ˆ๋ผ ์›๊ฒฉ API, DB ๋ฐ์ดํ„ฐ๊นŒ์ง€ Zod ์Šคํ‚ค๋งˆ๋กœ ์™„๋ฒฝํ•˜๊ฒŒ ํƒ€์ž… ๊ฒ€์ฆํ•ฉ๋‹ˆ๋‹ค.

โ‘  ์Šคํ‚ค๋งˆ ์ •์˜ (src/content.config.ts)

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

// ๋ธ”๋กœ๊ทธ ์ปฌ๋ ‰์…˜ ์ •์˜
const blog = defineCollection({
  // src/content/blog ๋””๋ ‰ํ† ๋ฆฌ์˜ ๋ชจ๋“  md, mdx ํŒŒ์ผ ํƒ์ƒ‰
  loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/blog' }),
  schema: z.object({
    title: z.string(),
    description: z.string(),
    pubDate: z.coerce.date(),
    tags: z.array(z.string()).default([]),
    draft: z.boolean().default(false),
  }),
});

export const collections = { blog };

โ‘ก ๋งˆํฌ๋‹ค์šด ๋ณธ๋ฌธ ํŒŒ์‹ฑ ๋ฐ ๋ Œ๋”๋ง (src/pages/blog/[...slug].astro)

---
// src/pages/blog/[...slug].astro
import { getCollection, render } from 'astro:content';
import BaseLayout from '../../layouts/BaseLayout.astro';

export async function getStaticPaths() {
  // ์ดˆ์•ˆ(draft)์ด ์•„๋‹Œ ๊ธ€๋งŒ ํ•„ํ„ฐ๋ง
  const posts = await getCollection('blog', ({ data }) => !data.draft);
  return posts.map((post) => ({
    params: { slug: post.id },
    props: { post },
  }));
}

const { post } = Astro.props;
// Astro 5์˜ render() ํ•จ์ˆ˜๋ฅผ ํ†ตํ•ด ๋งˆํฌ๋‹ค์šด ํŒŒ์‹ฑ ์ปดํฌ๋„ŒํŠธ ํš๋“
const { Content, headings } = await render(post);
---

<BaseLayout title={post.data.title} description={post.data.description}>
  <article class="blog-article">
    <h1>{post.data.title}</h1>
    <p class="date">๋ฐœํ–‰์ผ: {post.data.pubDate.toLocaleDateString('ko-KR')}</p>
    <div class="tags">
      {post.data.tags.map((tag) => <span class="tag">#{tag}</span>)}
    </div>
    <hr />

    <!-- ๋ณ€ํ™˜๋œ ๋งˆํฌ๋‹ค์šด ๋ณธ๋ฌธ ์ž๋™ ์ถœ๋ ฅ -->
    <div class="markdown-content">
      <Content />
    </div>
  </article>
</BaseLayout>

<style>
  .date { color: #94a3b8; font-size: 0.9rem; }
  .tag { background: #334155; padding: 2px 6px; border-radius: 4px; margin-right: 6px; font-size: 0.8rem; }
  .markdown-content { line-height: 1.8; color: #e2e8f0; }
</style>

6. [3๋‹จ๊ณ„] ์‹ค๋ฌด ์‘์šฉ: UI ํ”„๋ ˆ์ž„์›Œํฌ ์•„์ผ๋žœ๋“œ & ์ „์—ญ ์ƒํƒœ ๊ณต์œ  (Frameworks & Nano Stores)

ํ•˜๋‚˜์˜ Astro ํŽ˜์ด์ง€ ์•ˆ์—์„œ React ์ปดํฌ๋„ŒํŠธ์™€ Vue ์ปดํฌ๋„ŒํŠธ๋ฅผ ๋™์‹œ์— ๊ตฌ๋™ํ•˜๊ณ , ์ดˆ๊ฒฝ๋Ÿ‰ ์ƒํƒœ ๊ด€๋ฆฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ธ Nano Stores๋ฅผ ํ†ตํ•ด ํ”„๋ ˆ์ž„์›Œํฌ ๊ฐ„ ์–‘๋ฐฉํ–ฅ ์ƒํƒœ๋ฅผ ๊ณต์œ ํ•ฉ๋‹ˆ๋‹ค.

โ‘  ๊ณตํ†ต ์ „์—ญ ์Šคํ† ์–ด ์ •์˜ (src/stores/cart.ts)

// src/stores/cart.ts
import { atom } from 'nanostores';

export interface CartItem {
  id: string;
  name: string;
  price: number;
}

// ์žฅ๋ฐ”๊ตฌ๋‹ˆ ์•„์ดํ…œ ๋ฐฐ์—ด ์Šคํ† ์–ด
export const $cart = atom<CartItem[]>([]);

// ์•„์ดํ…œ ์ถ”๊ฐ€ ์•ก์…˜
export function addToCart(item: CartItem) {
  $cart.set([...$cart.get(), item]);
}

โ‘ก React ์ปดํฌ๋„ŒํŠธ: ์ƒํ’ˆ ์ถ”๊ฐ€ ๋ฒ„ํŠผ (src/components/AddToCartButton.tsx)

// src/components/AddToCartButton.tsx
import React from 'react';
import { addToCart, type CartItem } from '../stores/cart';

export default function AddToCartButton({ item }: { item: CartItem }) {
  return (
    <button
      onClick={() => addToCart(item)}
      className="px-4 py-2 bg-blue-600 hover:bg-blue-500 text-white rounded font-medium"
    >
      React ์„ฌ: ์žฅ๋ฐ”๊ตฌ๋‹ˆ ๋‹ด๊ธฐ ({item.price.toLocaleString()}์›)
    </button>
  );
}

โ‘ข Vue ์ปดํฌ๋„ŒํŠธ: ์‹ค์‹œ๊ฐ„ ์žฅ๋ฐ”๊ตฌ๋‹ˆ ์นด์šดํ„ฐ (src/components/CartCounter.vue)

<!-- src/components/CartCounter.vue -->
<template>
  <div class="vue-counter">
    <span>Vue ์„ฌ ์žฅ๋ฐ”๊ตฌ๋‹ˆ: <strong>{{ cartItems.length }}</strong> ๊ฐœ</span>
  </div>
</template>

<script setup lang="ts">
import { useStore } from '@nanostores/vue';
import { $cart } from '../stores/cart';

// Nano Stores ๋ฐ˜์‘ํ˜• ๋ฐ”์ธ๋”ฉ
const cartItems = useStore($cart);
</script>

<style scoped>
.vue-counter {
  background: #064e3b;
  color: #34d399;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
}
</style>

โ‘ฃ Astro ํŽ˜์ด์ง€์—์„œ ๋‘ ํ”„๋ ˆ์ž„์›Œํฌ ๊ฒฐํ•ฉ (src/pages/shop.astro)

---
// src/pages/shop.astro
import BaseLayout from '../layouts/BaseLayout.astro';
import AddToCartButton from '../components/AddToCartButton.tsx';
import CartCounter from '../components/CartCounter.vue';

const sampleItem = { id: 'p1', name: 'Astro ํ›„๋“œํ‹ฐ', price: 49000 };
---

<BaseLayout title="๋ฉ€ํ‹ฐ ํ”„๋ ˆ์ž„์›Œํฌ ์‡ผํ•‘๋ชฐ">
  <div class="shop-header">
    <h1>ํ”„๋ ˆ์ž„์›Œํฌ ์•„์ผ๋žœ๋“œ ์—ฐ๋™</h1>
    <!-- Vue ์„ฌ: ์ƒ์‹œ ๋กœ๋“œ -->
    <CartCounter client:load />
  </div>

  <div class="product-box">
    <h2>{sampleItem.name}</h2>
    <!-- React ์„ฌ: ์ฆ‰์‹œ ๋กœ๋“œ ๋ฐ ํด๋ฆญ ์ด๋ฒคํŠธ ์ˆ˜์‹  -->
    <AddToCartButton client:load item={sampleItem} />
  </div>
</BaseLayout>

7. [3๋‹จ๊ณ„] ์‹ค๋ฌด ์‘์šฉ: ViewTransitions & API ์—”๋“œํฌ์ธํŠธ & SSR (Transitions & SSR)

๐ŸŽฌ SPA ๋ถ€๋“œ๋Ÿฌ์šด ํ™”๋ฉด ์ „ํ™˜: ClientRouter (View Transitions)

ํŽ˜์ด์ง€ ์ „์ฒด ์ƒˆ๋กœ๊ณ ์นจ ์—†์ด ๋ชจ๋ฐ”์ผ ์•ฑ์ฒ˜๋Ÿผ ๋งค๋„๋Ÿฝ๊ฒŒ ํ™”๋ฉด์ด ์ „ํ™˜๋˜๋„๋ก <ClientRouter />๋ฅผ ํ—ค๋”์— ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

---
// src/layouts/BaseLayout.astro (์ƒ๋‹จ ์ถ”๊ฐ€)
import { ClientRouter } from 'astro:transitions';
---
<head>
  <!-- Astro 5 ํ‘œ์ค€ (Astro 4์—์„œ๋Š” ViewTransitions) -->
  <ClientRouter />
</head>

๐Ÿ”Œ ๋ฐฑ์—”๋“œ REST API ์—”๋“œํฌ์ธํŠธ (src/pages/api/posts.json.ts)

์„œ๋ฒ„๋ฆฌ์Šค ํ•จ์ˆ˜๋‚˜ Node.js ๋ฐฑ์—”๋“œ๋กœ ๋™์ž‘ํ•˜๋Š” API ๋ผ์šฐํŠธ์ž…๋‹ˆ๋‹ค.

// src/pages/api/posts.json.ts
import type { APIRoute } from 'astro';

export const GET: APIRoute = async ({ request, url }) => {
  const data = [
    { id: 1, title: 'Astro 5 Release', views: 1250 },
    { id: 2, title: 'Islands Deep Dive', views: 3400 },
  ];

  return new Response(JSON.stringify(data), {
    status: 200,
    headers: {
      'Content-Type': 'application/json; charset=utf-8',
      'Cache-Control': 'public, max-age=60',
    },
  });
};

export const POST: APIRoute = async ({ request }) => {
  const body = await request.json();

  return new Response(JSON.stringify({ success: true, received: body }), {
    status: 201,
    headers: { 'Content-Type': 'application/json' },
  });
};

๐ŸŒ SSR ํ•˜์ด๋ธŒ๋ฆฌ๋“œ(Hybrid) ๋ Œ๋”๋ง ์–ด๋Œ‘ํ„ฐ ์„ค์ •

์ผ๋ถ€ ๋™์  ๋กœ๊ทธ์ธ ์„ธ์…˜ ํŽ˜์ด์ง€๋‚˜ ์‹ค์‹œ๊ฐ„ API๋งŒ ์„œ๋ฒ„์—์„œ ๊ณ„์‚ฐํ•˜๊ณ , ๊ธฐ๋ณธ ํŽ˜์ด์ง€๋Š” ์ •์  HTML(SSG)๋กœ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

// astro.config.mjs
import { defineConfig } from 'astro/config';
import node from '@astrojs/node'; // ๋˜๋Š” @astrojs/cloudflare, @astrojs/vercel

export default defineConfig({
  // Astro 5์—์„œ๋Š” output: 'static'์ด ๊ธฐ๋ณธ์ด๋ฉฐ, ํŽ˜์ด์ง€๋ณ„ export const prerender = false ์„ ์–ธ
  adapter: node({
    mode: 'standalone', // ๋…๋ฆฝํ˜• Node.js ์›น์„œ๋ฒ„ ์‹คํ–‰
  }),
});
---
// src/pages/dashboard.astro (๋™์  SSR ํŽ˜์ด์ง€ ์„ ์–ธ)
export const prerender = false;

// ๋งค ์š”์ฒญ๋งˆ๋‹ค ์ฟ ํ‚ค ํ™•์ธ ๋ฐ ์‹ค์‹œ๊ฐ„ ์‚ฌ์šฉ์ž ์ธ์ฆ
const sessionCookie = Astro.cookies.get('user_session');
if (!sessionCookie) {
  return Astro.redirect('/login');
}
---
<h1>์‹ค์‹œ๊ฐ„ SSR ๋Œ€์‹œ๋ณด๋“œ (์‚ฌ์šฉ์ž: {sessionCookie.value})</h1>

8. CLI ํ•„์ˆ˜ ๋ช…๋ น์–ด & ๋นŒ๋“œ ํ™˜๊ฒฝ (CLI Commands & Config)

๐Ÿ’ป ํ•„์ˆ˜ ํ„ฐ๋ฏธ๋„ ๋ช…๋ น์–ด

# [1] ๋กœ์ปฌ ๊ฐœ๋ฐœ ์„œ๋ฒ„ ์‹œ์ž‘ (๊ธฐ๋ณธ ํฌํŠธ: 4321)
npx astro dev
# ํŠน์ • ํฌํŠธ ์ง€์ • ์‹คํ–‰
npx astro dev --port 3000 --host

# [2] ํ”„๋กœ๋•์…˜ ์ •์  HTML ๋นŒ๋“œ ์‹คํ–‰ (dist/ ํด๋” ์ƒ์„ฑ)
npx astro build

# [3] ๋นŒ๋“œ๋œ ํ”„๋กœ๋•์…˜ ์•„ํ‹ฐํŒฉํŠธ ๋กœ์ปฌ ๋ฏธ๋ฆฌ๋ณด๊ธฐ (Preview)
npx astro preview

# [4] ํ”„๋กœ์ ํŠธ ์ „์ฒด ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ๋ฐ Astro ์ปดํฌ๋„ŒํŠธ ๊ฒ€์‚ฌ
npx astro check

# [5] Astro ํ™˜๊ฒฝ ๋ฐ ์„ค์น˜๋œ ์˜์กด์„ฑ ์ƒ์„ธ ์ง„๋‹จ ๋ณด๊ณ ์„œ ์ถœ๋ ฅ
npx astro info

9. ์‹ค๋ฌด ํŠธ๋Ÿฌ๋ธ”์ŠˆํŒ… & ํ”„๋กœ๋•์…˜ ์šด์˜ ์ฒดํฌ๋ฆฌ์ŠคํŠธ (Troubleshooting & Best Practices)

โš ๏ธ ์ดˆ๋ณด์ž๊ฐ€ ๊ฐ€์žฅ ํ”ํžˆ ๊ฒช๋Š” 5๋Œ€ ์‹ค์ˆ˜ ๋ฐ ํ•ด๊ฒฐ์ฑ…

์ฆ์ƒ ๋ฐ ๋ฌธ์ œ์ ์›์ธ ๋ถ„์„ํ™•์‹คํ•œ ํ•ด๊ฒฐ ๊ฐ€์ด๋“œ
ํ”„๋ก ํŠธ๋งคํ„ฐ์˜ console.log()๊ฐ€ ๋ธŒ๋ผ์šฐ์ €์— ์•ˆ ์ฐํž˜ํ”„๋ก ํŠธ๋งคํ„ฐ(---) ์ฝ”๋“œ๋Š” ์„œ๋ฒ„/๋นŒ๋“œ ์‹œ์ ์— ์‹คํ–‰๋จ๋ธŒ๋ผ์šฐ์ € ์ฝ˜์†”์—์„œ ๋ณด๋ ค๋ฉด ํ•˜๋‹จ์— <script>console.log(...)</script> ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉ
React ์ปดํฌ๋„ŒํŠธ์˜ ๋ฒ„ํŠผ ํด๋ฆญ(onClick)์ด ๋ฌด๋ฐ˜์‘ํด๋ผ์ด์–ธํŠธ ์ˆ˜ํ™” ๋””๋ ‰ํ‹ฐ๋ธŒ(client:*)๋ฅผ ์ง€์ •ํ•˜์ง€ ์•Š์Œ<MyButton client:load /> ๋˜๋Š” client:visible ๋””๋ ‰ํ‹ฐ๋ธŒ ํ•„์ˆ˜ ๋ช…์‹œ
document is not defined / window is not defined ์—๋Ÿฌ์„œ๋ฒ„ ์‚ฌ์ด๋“œ ๋ Œ๋”๋ง ์‹œ์ ์— ๋ธŒ๋ผ์šฐ์ € ์ „์šฉ ๊ฐ์ฒด์— ์ ‘๊ทผํ•จReact๋Š” useEffect(), Astro๋Š” <script> ํƒœ๊ทธ ์•ˆ์—์„œ ๋ธŒ๋ผ์šฐ์ € ๊ฐ์ฒด ์ ‘๊ทผ
getStaticPaths() returned undefined ๋นŒ๋“œ ์—๋ŸฌSSG ๋™์  ๋ผ์šฐํŠธ([slug].astro)์—์„œ ๋ฐฐ์—ด์„ ๋ฐ˜ํ™˜ํ•˜์ง€ ์•Š์Œreturn [{ params: { slug: 'a' } }] ํ˜•์‹์˜ ๋ฐฐ์—ด์„ ๋ฐ˜๋“œ์‹œ ๋ช…์‹œ์ ์œผ๋กœ ๋ฐ˜ํ™˜
์™ธ๋ถ€ ์ด๋ฏธ์ง€ ๋กœ๋”ฉ ์‹œ ๋นŒ๋“œ ์ง€์—ฐ ๋ฐ ๋Œ€์—ญํญ ๋‚ญ๋น„์ผ๋ฐ˜ <img> ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•ด ์›๋ณธ ํฌ๊ธฐ ๊ทธ๋Œ€๋กœ ์ „์†ก๋จAstro ๋‚ด์žฅ <Image src={myImage} alt="์„ค๋ช…" width={600} /> ์ตœ์ ํ™” ์ปดํฌ๋„ŒํŠธ ์‚ฌ์šฉ

๐Ÿš€ ํ”„๋กœ๋•์…˜ ๋ฐฐํฌ ์ฒดํฌ๋ฆฌ์ŠคํŠธ (Production Checklist)

  1. ์ •์  ์‚ฌ์ดํŠธ ์ฃผ์†Œ(site) ๋ช…์‹œ: astro.config.mjs์— site: 'https://techworld.sulucky5.pe.kr'๋ฅผ ๋ฐ˜๋“œ์‹œ ์„ค์ •ํ•˜์—ฌ sitemap.xml ๋ฐ Canonical URL์ด ์˜ฌ๋ฐ”๋ฅธ ๋„๋ฉ”์ธ์œผ๋กœ ์ƒ์„ฑ๋˜๋„๋ก ๋ณด์žฅํ•ฉ๋‹ˆ๋‹ค.
  2. ์†Œ์…œ ๋ฉ”ํƒ€ ํƒœ๊ทธ (OpenGraph): <meta property="og:title" content={title} />, <meta property="og:image" content={new URL(image, Astro.site)} /> ๋“ฑ ์ ˆ๋Œ€ URL๋กœ ๊ณต์œ  ์ด๋ฏธ์ง€๋ฅผ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.
  3. ๋นŒ๋“œ ์บ์‹ฑ ์ตœ์ ํ™”: CI/CD ํŒŒ์ดํ”„๋ผ์ธ(GitHub Actions)์—์„œ node_modules์™€ .astro ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ์บ์‹œํ•˜์—ฌ ๋นŒ๋“œ ์‹œ๊ฐ„์„ 70% ์ด์ƒ ๋‹จ์ถ•ํ•ฉ๋‹ˆ๋‹ค.
๐Ÿ’ฌ

์˜๊ฒฌ ๋ฐ ์งˆ๋ฌธ

0
0 / 1500