This is a minimal Astral site that exercises the current core features:
- Markdown pages with MDEx frontmatter
- plain HTML pages
- HEEx-first
.astralpages, layouts, and local components - default
.astraland per-page EEx layouts - public static files
- Volt-managed TypeScript and CSS
- schema-validated posts in
content/posts - dynamic collection detail pages with
pages/blog/[slug].astral - setup-declared dynamic tag pages with
pages/tags/[tag].astral - custom root 404 page written to
dist/404.html - generated
/feed.xmland/sitemap.xmlroutes - Astral's development server
- Volt JS/TS formatting and linting
mix deps.get
mix astral.devOpen http://localhost:4000.
Try editing files in pages/, components/, content/posts/, layouts/, public/, or assets/ while the server is running.
The layout uses Astral.asset_path(@site, "app.ts"); it returns /assets/app.ts in dev and /assets/app.js for this example's static build. The example sets hash false in astral.config.exs so static builds emit dist/assets/app.js.
This example follows Volt's formatting and linting setup:
.formatter.exsinstallsVolt.Formattersomix formatformats TypeScript too.config/config.exsconfiguresconfig :volt, :formatandconfig :volt, :lint.mix checkrunsmix format --check-formattedandmix volt.js.check --type-aware --type-check.
mix checkmix deps.get
mix astral.buildThe output is written to dist/.
//about//blog/hello-astral/fromcontent/posts/hello-astral.mdrendered bypages/blog/[slug].astral/tags/astral/generated frompages/tags/[tag].astral/components//landing//raw//404/served with 404 status in development and written todist/404.html/robots.txt/feed.xml/sitemap.xml