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

as mentioned earlier, It will be nice if/when these components can also be defined within HTML

<template tag="user-avatar" parameters="[src,alt]"> <img src="{src}" alt="{alt}"/> </template



There _is_ a <template> element[0] for this purpose, but so far it falls short on being able to inject parameters like that, and is essentially useless if you don't have Javascript.[1]

[0]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/te...

[1]: https://developer.mozilla.org/en-US/docs/Web/API/Web_compone...


I got the impression that the people defining the web standards just gave-up on letting things work without javascript.

If you don't want to import things like a frontend framework and HTMX parser, the templates are incredibly useful. They are also very useful for the backend to pass structure over to the frontend, as they are plain HTML. What they do not do is helping with the things that a static site generator will do.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: