Hacker News new | ask | show | jobs
by indigodaddy 1600 days ago
Hey guys, anyone know if there is any server/webserver that can actually serve raw markdown files as html? I think Harp can do it but I was just wondering if there is anything else. Thanks.
3 comments

Yep, just enable templates with the 1 line of config and then put {{markdown "here"}} in your web pages and there you have it.

Caddy's entire docs are powered by this kind of templating, it's quite useful: https://github.com/caddyserver/website/blob/master/src/docs/...

This is awesome I’ll be exploring this for sure! I was going to mess around with Harp but don’t think it gets updated much, and also it seemed overly complicated in general even without considering the templating stuff..

So how does Caddy accomplish this sort of processing? Just somehow on-the-fly converts to html? Anyway I’ll check it out— would have to also figure out theming/templating if there is also basic functionality for that..

Also this gives me another idea that is going to sound weird. But given this new info, I’m thinking of hosting Caddy+some_md_content on Replit hosting (as Replit can host any Go application (or virtually any language I believe)). This way I can use the Replit web UI if I want, to create md/posts, and then Caddy-on-top-of-replit will serve the page.

Is this weird? I think it’s feasible right? I could/should also put Cloudflare in front perhaps in case of unexpected traffic as Replit’s free tier doesn’t provide a ton of transfer o don’t believe..

Holy crap I had no idea, wow!
Possibly the reason why you had no idea is that Caddy -- while legitimately amazing -- has documentation that feels something like you're playing a 1980s text adventure, stuck in a maze of twisty tunnels.
You could probably set up some kind of pipe or shell script with your favorite md renderer/compiler in apache or lighttpd. CGI is a surprisingly simple protocol
What is a "md5 file"?
Sorry meant to say md (markdown). Edited my comment.