4 ms·
Show HN: Hmpl – work with server-side HTML with ease
- nbbaier 2y agoLooks cool! Will play around with this!
- ulrischa 2y agoI wonder why I should not simply use a good old php include for the first example
- meiraleal 2y agothis seems to work with static assets, so no need for a old php server. But also you don't need much more than those lines of JS: document.addEventListener('DOMContentLoaded', () => { const t = document.querySelector('template[data-hmpl]'); t && fetch(t.dataset.src, { method: t.dataset.method }) .then(res => res.text()) .then(html => t.outerHTML = \`<div>\${html}</div>\`)});
- orphea 2y ago[flagged]
- jslakro 2y agoI find a "pure" html approach interesting. What's the problem with these little projects? They are closer to the hacker spirit that many posts that reach the first page from companies injected with vc money that also are doing their own marketing
- meiraleal 2y agoI agree with you and thought this comment was a bit too harsh. So I went to OP profile and posting variations of this same project is the only thing he does in HN. Which is against the guidelines.
- orphea 2y agoI love little projects, no problem with them at all. But when all author's submissions and comments are trying to promote his project(s), don't you think it's a bit too far?
- deleted 2y ago[deleted]