Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Any server-side language with your favorite web-framework and HTML templates system. Static files, PHP, Go, Ruby, ASP.NET Core, Spring etc, as long as you can send HTML pages and HTML partials, you are all set


Thanks. So a static site, on neocities.org, for instance can serve files in response to requests such as the examples using hx-swap="outerHtml". Is there a simple example of a static site using Htmx somewhere?


> So a static site, on neocities.org, for instance can serve files in response to requests such as the examples using hx-swap="outerHtml"

Exactly. It can serve HTML partials, or utilize `hx-select` attribute to extract required elements from a full page

> Is there a simple example of a static site using Htmx somewhere?

Not that I'm aware of unfortunately


The code is not done yet but I can explain how we're going to use htmx and Hypermedia APIs for the static site of a national chess federation (it's static to avoid hacking/ddos from disgruntled russians). Every week, new chess ratings are calculated from the reports of in-person / over-the-board tournaments. At build-time (Hugo/Netlify), a static HTML fragment is created for each member and included in the site's static files. At run-time, when a member's info is requested, htmx will fetch the member's HTML fragment and insert it into the appropriate <div>. At run-time, there is no server-side code executing nor database so it's fast, highly available, and almost unhackable.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: