Migrating the Netlify Blog from Hugo to Eleventy using Sanity
Blog post from Sanity
Netlify recently undertook the task of migrating over 700 markdown files, each representing a blog post, from Hugo to Eleventy, integrating them into an internal Sanity instance to streamline their development process and reduce client-side JavaScript. The migration was facilitated by Sanity's markdown-to-sanity tool, which converts markdown files into newline-delimited JSON (NDJSON) format, making them ready for import into Sanity using its CLI tool. Authors' reference IDs were retrieved from existing Sanity data to maintain consistency, and Eleventy was used to render the blog posts, leveraging its global data features and pagination for creating static HTML files. The process also involved using Vue templates to render markdown into HTML and incorporating Eleventy's Render Plugin and syntax highlighting for code blocks. Despite initial concerns, the migration was straightforward due to Sanity's robust tools and support from collaborators, showcasing the power of modern development tools in handling large-scale data transitions efficiently.