- Author
- app-hacks
- Published
- Updated
- Reviewed
Astro / Quality Assurance / SEO
Pre-Publish Checks for an Astro Blog: HTML, Links, and Metadata
Verify static generation, output HTML, internal links, metadata, and structured data before publishing an Astro blog, separating recorded results from general checks.
An Astro blog can look correct in a browser while generated HTML lacks a canonical or structured data and internal links point nowhere. Source review alone misses URL assembly and sitemap issues that appear only after static generation.
This article separates checks actually run in this repository from reusable pre-publish methods. It does not claim deployment results for unlisted services or browser checks that were not performed.
Source code is not the published artifact
npm run build performs content loading, frontmatter validation, static route generation, and sitemap integration. This repository’s .nvmrc specifies Node.js 22.22.2, so the recorded sequence is:
nvm use
npm run build
After a successful build, inspect dist, not only source components.
Inspect generated files and the sitemap
Confirm dist/index.html, article dist/blog/.../index.html files, and dist/sitemap-index.xml:
rg --files dist | rg '(^dist/index\.html$|sitemap-index\.xml$|/index\.html$)'
Each article should have a unique title and description, canonical link, article:published_time, and JSON-LD for BlogPosting and BreadcrumbList. This site had a place for an OGP image but no real shared image, so it intentionally emitted zero og:image and twitter:image tags. When an image is added, verify that its generated URL points to a real file.
Check links and image URLs mechanically
Extract root-relative href values from generated HTML and map them to output HTML or static files. This covers related-article links, headers, footers, and list pages in one pass. Apply the same process to <img>, og:image, and twitter:image only when those URLs exist. Do not publish placeholder image URLs and defer checking them.
Results recorded for this site
On September 11, 2026, npm run build ran under Node.js 22.22.2 and generated 15 static pages plus dist/sitemap-index.xml. The same work found zero broken internal links. All 10 published articles contained BlogPosting and BreadcrumbList; actual og:image and twitter:image tags numbered zero.
With Node.js 20.18.2, Astro did not start the build because it required Node.js 22.12.0 or later. That was an environment mismatch, not an article or link error. Running nvm use and checking node --version separates it before content diagnostics.
Do not validate with file://
Opening generated HTML directly with file:// does not reproduce hosting. Root-relative assets such as /_astro/ resolve against the filesystem root instead of dist, so CSS or images may fail. This work did not measure a file:// rendering. Use the Astro development or preview server and check over http://localhost.
Pre-publish checklist
- The Node.js version after
nvm usesatisfies the project requirement. -
npm run buildsucceeds and generatesdistand the sitemap. - Generated HTML contains title, description, canonical, article dates, and JSON-LD.
- Every generated internal link resolves.
- Any image URL in HTML or metadata points to a real output file.
- Visual checks use localhost or a preview server, not
file://.