I spent an afternoon debugging why my newly launched site rendered without styles in Google's crawler. The content was there. The CSS was not. The culprit was a single line in robots.txt that I had copied from an old project without thinking.
The line was Disallow: /_astro/ .
Why that line is a problem
Astro puts all compiled CSS and JavaScript under /_astro/ . Modern search engines render pages with JavaScript, which means they need to fetch those assets to see the page the way a visitor does. Blocking the asset directory does not hide the assets from users β it hides them from the crawler doing the rendering.
The result is a page that looks unstyled and script-free to Google. It still gets indexed, but it looks like a broken 1998 page in the rendered view.
The fix
Remove the rule. Static CSS and JS cost you nothing in crawl budget and should always be fetchable.β¦