3 ms·
tangential, but what do people generally do when they want mostly a static site, but a small amount of dynamic content/interactivity here and there? Seems like
by paulmd 5y ago
tangential, but what do people generally do when they want mostly a static site, but a small amount of dynamic content/interactivity here and there? Seems like a common use-case that as sites grow they might want a little bit of not-static here and there.
Obviously not that difficult to add some javascript and APIs if you want, which avoids the need to mix in a different stack while generating the same look-and-feel. Or you can use NGINX/Apache frontend to redirect certain paths to a more traditional dynamic stack/CMS of course. Just curious if there's any "standard" approach or off-the-shelf tooling for that for (eg) Jekyll or similar.
- rpastuszak 5y agoVercel (with or without Next) is my stack of choice for projects like this. You can get a site running in Vercel+Next in <2m from ‘git init’. I use it for https://potato.horse https://potato.horse and most PoCs now, but we’ve scaled Vercel+Next to hundreds of thousands of users per day in other projects. You could also use Netlify with Netlify functions, although I prefer the (slightly) less opinionated way of handing releases and per-commit vanity URLs Vercel offers. Aaand if you want to get more funky with your approach, check out Astrojs (island architecture: start with static content and sprinkle the interactions on top of it). You could also try, Elixir + Phoenix + Live View if you want to learn a new tech stack, feed your brain, and… spend a few days yak shaving. Nope, none of the 5 new versions of your blog will be live by the time you’re done, but you’ll become good friends with Erlang and co. Speaking from the experience, I use next when I want my stack to be boring.
- mxuribe 5y agoIt depends *where* said dynamic content/interactivity is desired. If its desired at the page level, such as one page is desired to be dynamic...Then i keep everything else produced by my static site generator (in my case Pelican), and then set up a subdirectory and use php. (PHP because pretty much any web host, VPS provider etc. either already comes with PHP or its pretty easy to setup. But also because i faovr php development for the web.) Your comment about leveraging redirecting to certain paths via nginx/apache is something i've done in the past also...but unless you have a nice (automated, or at least easy) workflow...that could get old fast. ...However, if what you want is dynamic content/interactivity within the context of a page that is served static from your SSG process, then I (reluctantly) resort to javascript (Sorry, my reluctance is because i'm not much of a fan of javascript...and in fact have tried to omit as much of it as reasonable from my projects.)