Generate static sites from Markdown files with Caddy (2018)
blog.thomaspuppe.de
blog.thomaspuppe.de
These links can help with Caddy V2 Markdown usage:
https://caddyserver.com/docs/caddyfile/directives/templates
https://github.com/caddyserver/website/blob/master/src/docs/...
https://caddy.community/t/markdown-support-in-v2/6984
Thanks to the Caddy team for such an excellent program!
What's your take on code formatting and syntax highlighting?
I only ask as I got so frustrated installing and using Jekyll on Azure that I ended up rolling my own markdown-to-webpage script that would format code snippets nicely.
There's a definitely gap in the market for something that's not quite WordPress, but better than Jekyll. Would be interested to see what you think.
What is really really nice, is that the templates[0] is written as a Caddy module. It means that you should be able to "clone" and extend it easily to experiment with complex modules.
You could definitely use it as a basis to have your CMS based on this module.
[0]: https://github.com/caddyserver/caddy/tree/master/modules/cad...
Compiled with Crystal-lang and SQLite; you just drop in a single binary and away you go.
But Caddy just might've convinced me to install it on my server for pet projects and giving it a test drive.
What difference do you see between apache and caddy that makes the move more worth it compared to apache and nginx? I guess the added value is much more going from apache to caddy but not apache to nginx, what added value is that for you?
I can see myself checking this out (but for v2, of course). It looks to be just as nice in this area as in the others.
More software should strive to be this user friendly.
1. Wordpress in a default install, definitely not static
2. Wordpress with a caching plugin, wherein the cache is generated on request is only expired on page update. Still not really static
3. Wordpress with a caching plugin, where the cache is created on page edit but still served by the PHP code
4. Wordpress with a caching plugin, where the cache is created on page edit but pushed to another server to serve (i.e. using it as a headless CMS)
5. Your standard markdown -> html static site tool
To me step 4 is when the resulting site crosses over to a static site.
Currently, I do all my HTML manually. I looked into static site generators recently but didn't really like anything I've seen, from Jekyll/Hugo to smaller projects like blogc…
Oh yeah, and when something on a page changes, you tell the cache to invalidate some tags.
Most static hosting providers are just a basic file/web server with a CDN in front. It’s especially interesting as they now have come full circle with generate-on-demand pages, which is basically a dynamic backend.
Or ask another way something like Caddy but with .org files instead of .md?
Ps: I Kno about org-publish but I want a webserver that executes org-publish without my involvement.
Caddy is very modular by design, so anyone can write plugins to augment its capabilities. The "templates" directive is in the standard distribution, because it's simple and generally useful.
1. generate html from markdown 2. copy the generated html to /var/www 3. Let nginx serve (and cache) it
Would caddy fulfil these requirements as well? Is it as performant as nginx?
If your workflow with static files cached by a CDN already works for you, then this is probably not going to help you.
I can have a dedicated server and host a ton of stuff with docker and use caddy to direct to each domain. I know nothing new, but config is easy compared to rest. And again, I can't stress enough how easy is to setup the SSL.
I'm going to donate some money because it really saved me a ton of time.
For static files the best setup I think it's cloudflare workers with kv and fallback on s3 bucket for huge files. S3 is much cheaper compared to kv storage. (Backblaze + cloudflare bandwidth it's also free. Caveat: if you host non website stuff like 3d assets or raw images you might be banned by cloudflare)
I'm hosting many websites for clients with this setup and it's very very reliable and can reach around 99 on Google page speed.