What was the quickest way to publish a static site with full-text search in April 2025?

April 13, 2025

On April 13, while looking for a replacement for my old blog, I searched for react ssg framework. The Jamstack directory gave me a shortlist. An hour and a half later I was searching for pagefind free. That second query gets closer to what I wanted: could a reader type a phrase from the middle of an old post and find it on a static site?1

For a new site where a documentation layout suited the articles, I would have picked Astro with Starlight. It had the fewest pieces to put together. As the February 2025 release notes put it, “Starlight provides site search out of the box using Pagefind.” I could add a Markdown article to the starter, run npm run build, and deploy the resulting dist/ directory. The build would index the article text, and the theme already had a search box. The index lived alongside the pages, so the same static host could serve both without a separate search subscription.234

Starting pointWhat I would chooseWork before a reader can search
A folder of Markdown articles, with freedom to choose the layoutStarlightAdd the articles and publish a production build. The starter supplies both indexing and the search interface.3
A blog that needs dated posts, author pages, and a feed on day oneDocusaurusIts blog plugin supplies those features. Add a community local-search plugin and check that it indexes blog posts. The official hosted Algolia route involved applying for DocSearch, connecting the index, and waiting for the first crawl.5
A working Hugo, Gatsby, or other blog that already produces an HTML file for each postKeep the generator and add PagefindRun Pagefind after the build, point it at the HTML output, and add its search interface to the existing layout. Publish the generated index with the site. Existing post URLs can stay in place.4

The Docusaurus showcase led me to Jest and its website source. That gave me a real site to look at when judging the layout. Astro’s Docusaurus migration guide made the cost of switching clearer: Markdown and some React components could carry over, while the page layout and navigation still needed attention. If all my old blog lacked was search, adding Pagefind to its existing HTML would have been the shorter job.67

For a first Starlight preview, I would take one old post, build the site, and search for a distinctive phrase that appears only in its body. A result that opens the right post would answer the search question. Whether its old links and publication date survive is the separate blog migration question.

References

Footnotes

  1. Jamstack. (n.d.). Site generators. Jamstack. ↩

  2. Swithinbank, C. (2025, February 17). Starlight 0.32. Astro Blog, “Multisite search support,” para. 1. ↩

  3. Starlight contributors. (n.d.). Getting started and Site search. Starlight Docs. ↩ ↩2

  4. Pagefind contributors. (n.d.). Pagefind. GitHub. The CloudCannon repository URL I opened that afternoon now redirects here. Pagefind contributors. (n.d.). Getting started with Pagefind. Pagefind Docs. ↩ ↩2

  5. Docusaurus contributors. (n.d.). Blog and Search. Docusaurus 3.7.0 Docs. ↩

  6. Docusaurus contributors. (n.d.). Docusaurus site showcase. Docusaurus. Jest contributors. (n.d.). Jest website source. GitHub. ↩

  7. Astro contributors. (n.d.). Migrating from Docusaurus. Astro Docs. ↩

© 2025 borui. All rights reserved. This content may be freely reproduced, displayed, modified, or distributed with proper attribution to borui and a link to the article: borui (2025-04-13). What was the quickest way to publish a static site with full-text search in April 2025?. https://caiborui.com/blog/2025-04-13-en-fastest-static-site-with-search

@misc{borui2025-24d5ca79,
  author = {borui},
  title = {{What was the quickest way to publish a static site with full-text search in April 2025?}},
  year = {2025},
  publisher = {borui's blog},
  url = {https://caiborui.com/blog/2025-04-13-en-fastest-static-site-with-search}
}