You don't have to build a ZIP archiver from scratch. Several high-quality libraries handle the heavy lifting:
If you're building your own script, here is the general logic used by most open-source tools: RSCE JS epub
: Let users "download as eBook" without needing a backend. You don't have to build a ZIP archiver from scratch
: Convert your blog's HTML into EPUB 3 XHTML documents. This usually involves stripping out scripts or non-standard tags that e-readers can't handle. This usually involves stripping out scripts or non-standard
If you're not looking to write a custom script today, there are excellent existing tools to bridge the gap: Generating an EPUB File in the Browser - Jim Nielsen's Blog
: A powerful, modern choice that works in both Node.js and the browser. It automatically handles the fetching of images and fonts, which is often the most tedious part of the process.