Questions You May Have #

I’d call this the “frequently asked questions” section, but I’m a loner on the Internet and no one has actually asked me any of these questions. But I like to pretend, so here goes!

Why just Liquid? #

GitHub Pages restricts what Jekyll plug-ins can run and only allows a few whitelisted ones. Sure, you can move your website to something else like Netlify or have an entire workflow on top of Travis but that requires effort. If you don’t know Ruby, do you really want to learn it just for a plug-in?

If you’re building a static website, why exactly are you going to put so much effort into writing JavaScript? What if your website has so many ads that visitors are forced to turn off JavaScript? Does your link tester even run through your website with JavaScript?

Being creative with Liquid is the only option left and is mostly familiar enough with designers who can adventure out and edit these Liquid snippets if they so please.

Why don’t you use {%- -%} tags? #

Whitespace control was added in Liquid 4 and Jekyll 3.5.0. Using whitespace control forces users to abide by these minimum requirements despite them not actually being necessary in these snippets. The next question will answer why it’s not necessary.

What’s the purpose of {% capture workspace %}? #

By wrapping all the logic and string manipulation in {% capture %}, all of the whitespace that would be generated by all the Jekyll tags are contained; that includes traditional <!-- HTML comments. Inside of this {% capture %}, I have another {% capture %} where I’m actually building the HTML I’m going to output. Thanks to the way Liquid works, we can take advantage of our generated HTML not obeying scope.

Because of this, I can put as much whitespace as I’d like in my snippets and no extra whitespace will be added to your website, just HTML.

Were you under the influence of something while writing this? #