Jekyll doesn’t do components? Liar!
I like the pushback from Katie Kodes here. I’ve said in the past that I don’t think server-side languages haven’t quite nailed “building in components” as well as JavaScript has, but hey, this is a good point:
1. Any basic fragment-of-HTML “component” you can define with JSX in a file and then cross-reference as
, you can just as easily define with Liquid in a file and cross-reference in Jekyll as
{% include MyComponent.html key=value %}
.2. Any basic fragment-of-HTML “layout” you can define with JSX in a file and then cross-reference as
Hello, world
, you can just as easily define with Liquid in a file and then cross-reference in the front matter of a Jekyll template aslayout: MyLayout
.
Any HTML preprocessor that can do partials with local variables is pretty close to replicating the best of stateless JavaScript components. The line gets even blurrier with stuff like Eleventy Serverless that can build individual pages on the fly by hitting the URL of a cloud function.
Direct Link to Article — Permalink
The post Jekyll doesn’t do components? Liar! appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.