This project converts the Critical MAS WordPress blog into a static Astro website.
Critical MAS (Michael Allen Smith) is a long-running personal blog covering fitness, nutrition, coffee, and urban exploration, spanning over two decades (2005-2025).
The site features 1,700+ posts with extensive commenting history (preserved as static content), detailed photography, and practical experiments in health optimization. This archive preserves 20 years of writing, research, and community discussion in a fast, modern format.
export-cm-wordpress/
βββ PRD.md # Product Requirements Document
βββ conversion-script/ # Node.js conversion tool
β βββ src/
β β βββ index.js # Main orchestrator
β β βββ parser.js # WordPress XML parser
β β βββ converter.js # HTML to Markdown
β β βββ comment-sanitizer.js # Remove PII from comments
β β βββ image-processor.js # Copy and organize images
β β βββ link-fixer.js # Fix internal links
β β βββ utils.js # Helper functions
β βββ config.js # Configuration
β βββ package.json
βββ astro-site/ # Astro static site
β βββ src/
β β βββ content/
β β β βββ config.ts # Content collections schema
β β β βββ posts/ # Generated markdown posts
β β βββ layouts/
β β β βββ BaseLayout.astro # Base page layout
β β βββ components/ # Reusable components
β β βββ pages/ # Site pages
β β βββ styles/
β β βββ global.css # Global styles
β βββ package.json
βββ criticalmas.WordPress.2025-11-10.xml # WordPress export
βββ uploads/ # WordPress media files
Convert WordPress XML to Markdown posts:
```bash cd conversion-script npm install npm run convert ```
For a dry run (preview only, no files written):
```bash npm run convert:dry-run ```
This will:
- Parse the WordPress XML export
- Convert HTML content to Markdown
- Sanitize comments (remove email, IP addresses)
- Copy referenced images to post folders
- Generate posts in
astro-site/src/content/posts/ - Create metadata files in
astro-site/src/data/
```bash cd ../astro-site npm install npm run dev ```
Visit http://localhost:4321 to preview the site.
```bash npm run build npm run preview ```
The built site will be in the dist/ folder.
- β
Preserved post URLs:
/YYYY/MM/post-slug/ - β Sanitized comments appended to posts
- β Images copied to post folders
- β Internal links converted to relative paths
- β Categories and tags preserved
- β Clean, minimal design (no blue colors!)
- β Responsive layout
- β Archive by year, category, and tag
Edit conversion-script/config.js to customize:
- Input/output paths
- Processing options
- Link conversion rules
- Logging verbosity
The site can be deployed to any static hosting provider:
- Netlify: Drag and drop the
dist/folder - Vercel: Connect your repo and deploy
- GitHub Pages: Push
dist/to gh-pages branch - Traditional hosting: Upload
dist/contents via FTP
- This is an archived blog - no CMS or editing capability
- Comments are historical only (closed for new comments)
- All PII removed from comments (email, IP, URLs)
- Images only copied if referenced in posts
- Conversion log saved to
conversion-script/conversion-log.txt
Missing images: Check conversion-log.txt for details on which images couldn't be found.
Broken links: The conversion validates internal links. Check the log for any issues.
Build errors: Run npm run build in astro-site to see detailed error messages.
Refer to the PRD.md for complete project documentation.