Search
xm
21.10.2020
This is a neat little HTML preprocessor from Giuseppe Gurgone. It has very few features, but one of them is HTML includes, which is something I continue to be baffled that HTML doesn’t support natively. There are loads of ways to handle it. I think it’s silly that it’s been...
A Community-Driven Site with Eleventy: Preparing for Contributions
19.8.2020
I’ve recently found myself reaching for Eleventy (aka 11ty) above all other tools when I want to develop a website. It’s hard to beat a static site generator that provides advanced templating opportunities while otherwise getting out of your way and allowing you to just create.
One...
What ya need there is a bit of templating
22.7.2020
I had a fella write in to me the other day. He had some HTML, CSS, and JavaScript, and it just wasn’t behaving like he thought it ought to. The HTML had some placeholders in it and the JavaScript had some data in it, and the assumption was that the data would fill the placeholders.
To those...
Making My Netlify Build Run Sass
9.6.2020
Let’s say you wanted to build a site with Eleventy as the generator. Popular choice these days! Eleventy doesn’t have some particularly blessed way of preprocessing your CSS, if that’s something you want to do. There are a variety of ways to do it and perhaps that freedom is part...
A Follow-Up to PHP Templating
28.2.2020
Not long ago, I posted about PHP templating in just PHP (which is basically HEREDOC syntax). I'm literally using that technique for some super basic templating I needed to do on this very WordPress site. The main pushback was that this kind of thing can be an XSS vulnerability. In my case, it's...
Web Component for a Code Block
18.2.2020
We'll get to that, but first, a long-winded introduction.
I'm still not in a confident place knowing a good time to use native web components. The templating isn't particularly robust, so that doesn't draw me in. There is no state management, and I like having standard ways of handling that. If...
Select an Element with a Non-Empty Attribute
5.2.2020
Short answer:
[data-foo]:not([data-foo=""] {
Longer answer (same conclusion, just an explanation on why we might need this):
Say you have an element that you style with a special data-attribute:
<div data-highlight="product"</div
You want to target that element and do special things when...
PHP is A-OK for Templating
4.2.2020
PHP templating often gets a bad rap for facilitating subpar code — but that doesn't have to be the case. Let’s look at how PHP projects can enforce a basic Model, View, Controller (MVC) structure without depending on a purpose-built templating engine.
But first, a very brief PHP history lesson
The...
PHP Templating in Just PHP
26.12.2019
With stuff like template literals in JavaScript and templating languages, like JSX, I've gotten used to wanting to write my HTML templates in one nice chunk and sprinkling in variables wherever I need them.
I had a situation where I needed to do that in "raw" PHP the other day, so I'm just...
“Headless Mode”
2.12.2019
A couple of months ago, we invited Marc Anton Dahmen to show off his database-less content management system (CMS) Automad. His post is an interesting inside look at templating engines, including how they work, how CMSs use them, and how they impact the way we write things, such as loops.
Well...
Weekly Platform News: Apple Deploys Web Components, Progressive HTML Rendering, Self-Hosting Critical Resources
13.9.2019
In this week's roundup, Apple gets into web components, how Instagram is insta-loading scripts, and some food for thought for self-hosting critical resources.
Apple deploys web components built using Stencil
The new Apple Music web app (beta) uses a JavaScript framework (Ember.js) but also...
Haunted: Hooks for Web Components
3.7.2019
I was just chatting with Dave and he told me about Haunted. It's hooks, but for native web components! Pretty cool. I think the existence of stuff like this makes using web components more and more palatable — particularly in that totally-native no-build-step-needed-at-all kinda way.
I...
React Starter: JSX Basics
11.6.2019
JSX is the templating language for React. JSX is also one of the main reasons why devs say they dislike React at first.
As with all new tools, there will be a learning curve. JSX is no diffe