$ show ashishb/wp2hugo
wp2hugo is a Go-based CLI tool for migrating WordPress XML exports to Hugo static sites. It processes WordPress content (posts, pages, custom post types) converting them to Hugo Markdown with appropriate front matter, handles media downloads, converts WordPress shortcodes and Gutenberg blocks to Hugo shortcodes, preserves metadata like GUID and taxonomies, and generates Hugo configuration files. The tool also includes a companion utility 'hugomanager' for site management tasks like backlink analysis, image optimization, and URL suggestions. The architecture is modular with clear separation between WordPress parsing, Hugo generation, media handling, and utility functions.
The LLM identified 4 files worth highlighting for reuse:
Implements a plugin-based approach to convert WordPress-specific HTML elements (YouTube embeds, iframes, galleries, etc.) to Hugo shortcodes using the html-to-markdown library. Demonstrates skill in extending third-party libraries with domain-specific converters while maintaining isolation from the core migration logic. Could be reused in any project requiring WordPress-aware HTML to Markdown conversion.
Provides comprehensive backlink URL normalization and filtering logic that identifies and excludes low-quality links from spam sites, scrapers, and link farms. Implements sophisticated heuristics for detecting undesirable backlinks while preserving valuable ones. Self-contained with no internal dependencies, making it easily extractable for use in other SEO analysis or link processing tools.
Handles media file downloads with intelligent caching, retry mechanisms for rate limiting, and automatic fallback to full-resolution images when thumbnails are encountered. Demonstrates robust error handling for network issues and HTTP errors while maintaining media integrity. The cache-aside pattern with smart fallback strategies makes it reusable in any media downloading application.
Converts both legacy WordPress gallery shortcodes and Gutenberg gallery blocks to Hugo gallery shortcodes with proper handling of attributes like columns and image IDs. Features robust fallback logic when gallery IDs are missing, using post attachments as alternatives. Shows expertise in handling multiple input formats through regex parsing and HTML processing while maintaining clean separation of concerns.