For my blog, I write posts in Markdown. Then the build process uses Pandoc to convert the posts into web pages and, for certain pages, PDF files typeset with TeX. For example, here is a post in both web and PDF versions:
(Web) https://blog.moertel.com/posts/2024-08-23-sampling-with-sql....
(Typeset PDF) https://blog.moertel.com/images/public_html/blog/pix-2024060...