Tech Stack · JavaScript
Astro
Content-first web framework that ships static HTML with zero JavaScript by default.
What it is
Astro renders pages to plain HTML at build time. Interactive JavaScript is opt-in per component, which makes it a good fit for blogs and docs. aigrama.net itself is built with Astro: posts are Markdown/MDX in a content collection, validated by a Zod schema, and deployed as static files.
CLI commands
| Command | What it does |
|---|---|
npm create astro@latest |
Scaffold a new project |
npm run dev |
Dev server with hot reload on http://localhost:4321 |
npx astro check |
Type-check .astro and .ts files |
npm run build |
Production build into dist/ |
npm run preview / npx astro preview |
Start the local preview server for dist/ |
npx astro preview stop |
Stop a running Astro preview server |
npx astro preview status |
Check if an Astro preview server is running |
npx astro add mdx |
Add an official integration |
When to use
npmvsnpx: Usenpm run <script>for shortcuts defined in your project’spackage.json(dev,build,preview,check). Usenpx <command>to run a CLI binary directly — either a locally installed one with extra subcommands/flags (likenpx astro preview stopornpx astro add mdx) or a one-off tool without installing it globally.
Content collections in one snippet
// src/content.config.ts
import { defineCollection } from 'astro:content';
import { glob } from 'astro/loaders';
import { z } from 'astro/zod';
const blog = defineCollection({
loader: glob({ pattern: '**/index.{md,mdx}', base: './src/content/blog' }),
schema: z.object({ title: z.string(), pubDate: z.coerce.date() }),
});
export const collections = { blog };
Query with getCollection('blog') and render with render(entry) from astro:content.