plentico / plenti

Static Site Generator with Go backend and Svelte frontend
https://plenti.co
Apache License 2.0
985 stars 50 forks source link

[Feature Request] Make plenti a caddy plugin #276

Open diyism opened 1 year ago

diyism commented 1 year ago

I rely on the two caddy plugins of https://github.com/caddy-dns/cloudflare and https://github.com/klzgrad/forwardproxy/tree/naive/ currently, so I can't leave the caddy ecosystem, but I very much yearn for the functionality of dynamic scripts and Svelte templates for the web server (https://github.com/caddyserver/caddy/issues/2690), is there any way to integrate the plenti into the caddy server?

jimafisk commented 1 year ago

Hi @diyism, that's an interesting concept, are you mainly looking to compile Svelte components in Go directly? I mean you could always point Caddy at the built assets that Plenti produces (we're actually evaluating Caddy for a hosted Plenti service), but it doesn't sound like that's what you're looking to do in this case? I guess I don't fully understand what it would look like to build a custom website using a Caddy plugin, but would enjoy being enlightened if you have ideas. Thanks!

diyism commented 1 year ago

I see that when I run "./plenti serve" it needs 2 seconds to build the files in the "public" directory.

I can't find an example plugin that I want for Caddy web server,

but there's a standalone project "algernon" (https://github.com/xyproto/algernon), after I run "./welcome.sh", I can modify the file of "algernon/samples/greetings/index.md", and immediately the content changed in the web page of "http://localhost:3000/greetings/", it's amazing.

but what a pity:

  1. algernon doesn't support svelte files, (https://github.com/xyproto/algernon/issues/125)
  2. algernon is not a caddy plugin, I need to forward traffic from the caddy to algernon's 127.0.0.1:3000 port.

so, I'm dreaming:

  1. Plenti can realize the realtime-rendering function for svelte files(for example "index.svelte")
  2. Plenti is a caddy plugin, I need only start the caddy server to avoid the traffic forwarding and a seperate process.