About the system I use for most of the blogging content on this site.
I write each page in Markdown which is then converted to HTML using Pandoc. Pandoc supports rendering embedded LaTeX equations to MathML, which I use extensively, for instance in my post about large sudokus or GCC arithmetic optimizations. Pandoc also supports setting id and class attributes on elements like headers, links and images. This gives a reasonable tradeoff between flexibility and simplicity and anything more specialized can be coded directly as HTML in the markdown files.
A page is rendered as an HTML fragment, which is then wrapped with a
header at the beginning and a footer at the end, all enclosed within an
<html>
tag. This also includes a
<head>
section containing a stylesheet and a title.
This does have the drawback that I can’t set a title or footer on a page
to page basis.
I have drawn some inspiration for the CSS styling from markdowncss Splendor. I have modified it, so my stylesheet.css is a bit simpler and also to add support for the table styles for the sudokus.