Astro Islands & SSR (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
What is the syntax of an `.astro` file (Frontmatter vs. Template)?
senior LevelCode ExampleComponentsAstro
In Simple Words:
Astro files (.astro) combine Markdown frontmatter with HTML-like templates:
astro
---
// Server-side code fence (runs ONLY on the server during build/render)
// Never shipped to the browser!
import UserCard from '../components/UserCard.astro';
const response = await fetch('https://api.example.com/users');
const users = await response.json();
---
<!-- HTML Template -->
<div class="user-list">
{users.map((user) => (
<UserCard name={user.name} email={user.email} />
))}
</div>
<style>
/* Scoped CSS by default! */
.user-list { display: grid; gap: 1rem; }
</style>