The hard part of publishing a personal Astro website is rarely the markup — it is the journey an idea takes from a private note to a public URL, and whether you can undo that journey safely. This walkthrough follows the path through this repository: where entries live, how the metadata layer is assembled, what the admin service can change, and how a build becomes visible or is reverted. The high-level tour lives on the project page; this article goes one level down.
Why is this site published as static HTML?
Because nearly everything it serves is prose. A file compiled once at build time answers faster and costs less than a page rendered on every request, and it arrives complete — no JavaScript needed for a crawler to read it. Astro compiles each route to HTML ahead of time, so a request is answered straight from nginx with no per-request rendering or database lookup.
The only client-side JavaScript is a handful of lines for the theme toggle and a privacy-friendly page-view beacon. There is no client framework, no hydration and no third-party script in the page.
How do Astro content collections model the pages?
Content lives as Markdown and MDX files under src/content/projects/{en,fa} and src/content/journal/{en,fa}. The schema in src/content.config.ts validates every file, and the collection id is derived from the file path with the extension stripped, so en/foo and fa/foo never collide.
Every entry shares a base frontmatter — title, date, lang, tags, summary, draft — plus optional SEO fields: seoTitle, seoDescription, keywords, image, imageAlt, schemaType, noindex, canonical, updated and faq. Project entries add tagline, highlights, featured, span and links.
---
title: "Example entry"
date: "2026-10-10"
lang: "en"
summary: "One-sentence answer shown as the quick-answer block."
tags: ["Astro"]
draft: false
---
A file is only rendered when it is not a draft and its dashboard status is published; otherwise it is skipped during the build. Dashboard edits are never written into the content file — they go to content-meta/overrides.json, keyed collection/lang/slug, and are merged in src/lib/content.ts.
How does the SEO/AEO layer work?
Every page carries its own title, description, keywords, canonical URL and optional noindex. src/lib/seo.ts builds the Open Graph and Twitter metadata and a JSON-LD @graph that includes the site’s Person entity and the node selected by schemaType — Article, TechArticle, HowTo, FAQPage, SoftwareApplication, SoftwareSourceCode, CreativeWork or WebPage.
For answer engines, the build also emits machine-readable companions: sitemap.xml with hreflang alternates and lastmod, robots.txt, llms.txt, per-language RSS feeds and a web manifest. Each entry’s summary is rendered as a “quick answer” block, and any frontmatter faq entries become a visible FAQ section with matching FAQPage structured data.
title / description / keywords / canonical
│
▼
src/lib/seo.ts ──► Open Graph + Twitter cards
│
▼
JSON-LD @graph (Person, WebSite, page node, BreadcrumbList, FAQPage)
How does the admin service publish a page?
admin/server.mjs is a Node HTTP server with no npm dependencies. It exposes a fixed route table; sensitive routes require a session, and every write requires a CSRF header. Authentication uses a scrypt password hash, an HttpOnly SameSite=Strict session cookie, a login rate limit and a strict Content-Security-Policy.
The dashboard is served under /admin/. It lists pages with filters, edits per-page SEO with a live preview, manages media and translations, toggles draft/disabled status with undo, and shows analytics, build logs and one-click rollback. Each page has a live check: the dashboard confirms whether the page is present in the current release and whether the public URL answers.
The companion Obsidian plugin, Vergo MDX Studio, authenticates with a revocable bearer token against the /api/studio/ endpoints. Media is staged and must match its SHA-256-derived name. Every page must compile and obey the site’s MDX rules; a broken page is rejected with the file and line number. Valid pages land in the dashboard inbox and nothing goes live until it is approved.
The full pipeline
Obsidian → /api/studio → Inbox → approve → astro build → releases/<ts> → current symlink.
How do atomic releases and rollbacks work?
When a build starts, the admin service runs the build command into a fresh directory under the site folder, then checks that it produced an index.html. Only on success does it move the output into releases/<timestamp> and replace the current symlink — by creating a new symlink beside the old one and renaming over it, which is atomic on POSIX filesystems.
nginx serves .../current, so the live site switches in one step. A failed build is deleted and the live site is never touched. The service keeps the last five releases, so a rollback is a single action that points current at an older release.
build → .build/<ts> ──success──► releases/<ts> ──► current (symlink; atomic rename)
└──failure──► deleted; live site unchanged
What is not allowed in an MDX page?
The admin service validates every Obsidian submission and every dashboard edit against admin/lib/policy.mjs, rejecting the page with a file, line and column on any violation:
- Only the built-in components — any other
<Component>name is rejected. - No imports — pages need nothing beyond the built-ins.
- No
exportand no server-side APIs (process,require,fetch,import(), …), because MDX is compiled on the server. - Code inside fenced blocks is ignored by the rules, so an example like
import x from "y"is fine to show.
This is defence in depth, not a sandbox: every page still passes through a human approval. And because the site is static, there is no React and no client-side interactivity, so runtime handlers such as onClick are not available.
What are the limits?
- No client framework. Content cannot rely on browser-side interactivity; pages are HTML.
- Translations need a link. An English and a Persian page get hreflang and the language switcher only when they share a
translationKey. - Single operator. The admin service is built for one author with one password and a local data directory, not for multi-user hosting.
- Content is file-based. Publishing means a rebuild; there is no per-request editing.
What should you remember?
- arman-hosseini.ir is a bilingual (English and Persian) static site built with Astro 7 and Tailwind 4, with no client framework.
- Content is file-based and schema-validated; the SEO/AEO layer turns each entry into metadata, an Open Graph card and JSON-LD.
- A zero-dependency Node admin service edits content and builds atomic releases, keeping the last five for rollback.
- Pages arrive from Obsidian, are validated against a strict MDX policy, and wait for approval before going live.
- Start from the project page, read about the author, or browse the projects and the homepage.
References
- Astro documentation — content collections, MDX and static output.
- Tailwind CSS — the utility framework used for styling.
- JSON-LD 1.1 (W3C) — the syntax of the graph, which uses the Schema.org vocabulary.
- Node.js — the runtime for the admin service.