This repo is an Astro 5 + MDX site with optional React "islands," Tailwind CSS v4, math rendered through KaTeX, and a small PDF→image pipeline. It renders a single-page research project site from src/paper.mdx using src/pages/index.astro as the layout and a curated set of components.
- Astro + MDX content
- Entry content:
src/paper.mdx(MDX with YAML frontmatter). Frontmatter keys:title,authors,conference,notes,links,description,favicon,thumbnail,theme. - Layout:
src/pages/index.astroimports the content and frontmatter fromsrc/paper.mdx, sets<html data-theme>, OpenGraph tags, favicon, and usesimport.meta.env.BASE_URLto prefix public assets for GitHub Pages.
- Entry content:
- Components (examples)
Figure.astroprovides a consistent figure/caption pattern via named slotsfigureandcaption.Picture.astrowrapsastro:assetswith PDF support viasrc/lib/render-pdf.ts.srcaccepts either anImageMetadataimport or a string path ending with.pdf(path is resolved relative to./src/pages/).Video.astro,YouTubeVideo.astro,ModelViewer.astro(<model-viewer>),Carousel.astro/CarouselSlide.astro,Comparison.tsx(React compare slider). React components require aclient:*hydration directive when used inside MDX/.astro.- Math is rendered with
remark-math+rehype-katex, so just write inline$...$or block$$...$$expressions inside MDX—no dedicated component is needed.
- Styling
- Tailwind v4 via
@tailwindcss/vite; global styles insrc/styles/global.csswith a customdarkvariant keyed offdata-theme. - Code blocks themed with
astro-expressive-code(seeastro.config.tsstyleOverrides and theme selector).
- Tailwind v4 via
- TypeScript & paths
- TS strict config with JSX set to React; alias
@/*→./src/*intsconfig.json.
- TS strict config with JSX set to React; alias
- Node.js: Local docs recommend Node 24+. CI uses Node 20 (see
.github/workflows/astro.yml). If you adopt Node 24-only features, update the workflow accordingly. - Install & run
npm installnpm run dev→ http://localhost:4321npm run buildruns typecheck (astro check) thenastro buildnpm run previewserves the built site
- Lint/format (configured but no npm scripts):
- ESLint:
eslint.config.tscovers JS/TS/TSX, Astro, JSON, Markdown, and CSS (Tailwind v4 syntax). Run withnpx eslint .. - Prettier:
prettier.config.tswithprettier-plugin-astroandprettier-plugin-tailwindcss. Run withnpx prettier -w ..
- ESLint:
- Deploy
- GitHub Pages is the default. Pushing to
mainbuilds and deploys via.github/workflows/astro.yml. The workflow passes--site/--base, so useimport.meta.env.BASE_URLfor public URLs (the layout insrc/pages/index.astroalready handles favicon/OG). Vercel/Netlify buttons also exist inREADME.md.
- GitHub Pages is the default. Pushing to
- Content lives in
src/paper.mdx; import components at top and optionally map MD elements (e.g.,export const components = { table: Table }). - Layout logic lives in
src/pages/index.astro, which imports the content and frontmatter fromsrc/paper.mdxusingimport { Content, frontmatter } from "../paper.mdx". - Use the provided components for consistent layout:
- Wrap visuals in
<Figure>with slots:<slot name="figure"/>and<slot name="caption"/>. - Prefer
<Picture>for images. It accepts:- imported images (Astro's
ImageMetadata) for optimized images; or - a relative PDF path like
"../assets/plot.pdf"to auto-render page 1 to PNG during build/dev.
- imported images (Astro's
CarouselexpectsCarouselSlidechildren to render each slide; place any markup inside each slide and the component handles pagination buttons, swipe, and keyboard focus states for you.- For React, import the component and add a hydration directive where used, e.g.,
<Comparison client:idle>…</Comparison>.
- Wrap visuals in
- Theme handling
- Set
themein frontmatter todevice | light | dark. The layout insrc/pages/index.astrowritesdata-themeand Tailwind's customdarkvariant reads it. Use classdark:*utilities as needed; you can invert images in dark mode via<Picture invertInDarkMode />.
- Set
- Assets & paths
- Public assets in
public/are served at the base URL; when constructing absolute URLs in the layout (src/pages/index.astro) or components, prefix withimport.meta.env.BASE_URL(the layout already exposesprefix). - PDF conversion reads from
./src/pages/<path>and writes todist/_astro/<name>.png. In dev,Picture.astropoints to../dist/_astro/...; in prod it points to_astro/.... Only the first page is rendered at 4× scale.
- Public assets in
- Icons via
astro-iconusing Iconify sets (see dependencies@iconify-json/academicons,@iconify-json/ri). Example: frontmatterlinksitems includeicon: academicons:arxiv. - Code blocks are styled by
astro-expressive-code; don't manually theme them—follow the existing configuration inastro.config.ts. - To add a new interactive component:
- Create it under
src/components/(Astro or React). - Import it in
src/paper.mdx. - For React, add
client:*(e.g.,client:idle) at the usage site.
- Create it under
If anything here seems off or incomplete (tests aren’t defined, additional pages, alt deploys), tell me what’s missing and I’ll refine these instructions.