Architecting Vite SSG for AI Crawlers

How Truxo prerenders semantic HTML so search engines and AI answer engines get the full article without running any JavaScript.

Executive Summary

Search engines and AI answer engines increasingly index the HTML they receive on the very first request. This article explains how the Truxo web app prerenders content pages so crawlers get the complete, styled article with zero JavaScript execution.

Why prerender?

A client-rendered page ships an almost-empty HTML shell and fills it in with JavaScript after load. That works for logged-in application screens, but it is a poor fit for public content: many crawlers never execute JavaScript, so they see the empty shell instead of the article.

Prerendering flips this around. At build time we render each article to static HTML and write it to its own address, so the first response already contains the full text.

How it works

  • Articles are authored as MDX files in the repository.
  • At build time each article is rendered to HTML and written to /blog/<slug>.
  • The page ships styled and readable, then hydrates for the shared nav and footer.
  • The existing single-page app is left completely untouched on every other route.

What comes next

Later phases add rich, linked structured data (so machines understand who wrote the article and what it is about) and list every article in the sitemap and AI-crawler index — but the foundation is simply: real HTML, served fast, on its own URL.

About the author

Sukh

Team Lead at Truxo

Sukh leads the development wing at Truxo, building the platform end to end.

View all articles by Sukh

Wanna try Truxo?

Sign up for free today and run your loads, dispatch, and invoicing in one place.

Sign up for free