I use Python for that. It's just a few lines of code
template.html:
<header><h3>%(header)s</h3></header>
<div>%(content)s</div>
<footer>%(footer)s</footer>
generate.py: content = """# This is a markdown content"""
from markdown import markdown
with open('output.html', 'w') as f:
f.write(open('template.html').read() % {
'header': 'welcome',
'content': markdown.markdown(content),
'footer': 'amazing company inc'
})
for serving it: python3 -m http.server
it will be running on 127.0.0.1:8000