* docs: polish theme, playground, and reference pages Improve readability of the docs site with updated light/dark tokens, shared code-block styling, and playground editors that follow system color scheme. Skip CookieHub on localhost, serve the browser bundle from theme source, and use backtick titles on filter/tag reference pages for consistent navigation. Co-authored-by: Cursor <[email protected]> * docs: highlight npx in bash blocks and polish English copy Use Prism insertBefore for CLI commands like npx, tighten tutorial and reference wording, and keep YAML titles free of backticks so sidebar and page headings stay correct. Co-authored-by: Cursor <[email protected]> * docs: restore lowercase filter and tag titles Titles should match actual filter/tag identifiers (e.g. abs, append), not capitalized English labels. Co-authored-by: Cursor <[email protected]> --------- Co-authored-by: Cursor <[email protected]>
1.6 KiB
title
| title |
|---|
| Whitespace Control |
To keep source code neat and indented, we're adding spaces to our templates. LiquidJS offers whitespace control capabilities to eliminate these unwanted whitespaces in output HTML.
via Markups
By default, all tags and output markups lines will generate a NL (\n), and whitespaces if there's any indentation. For example:
{% author = "harttle" %}
{{ author }}
Outputs (note the blank line):
harttle
You can include hyphens in tag syntax ({% raw %}{{-{% endraw %}, -}}, {% raw %}{%-{% endraw %}, -%}) to strip whitespace from the left or right. For example:
{% assign author = "harttle" -%}
{{ author }}
Outputs:
harttle
In this case, the -%} strips the whitespace from the right side of the assign tag.
via Options
Alternatively, LiquidJS provides these per engine options to enable whitespace control without sweeping changes of your templates:
trimTagLefttrimTagRighttrimOutputLefttrimOutputRight
LiquidJS will NOT trim any whitespace by default, aka. above options all default to false. For details of these options, see the options.
Greedy Mode
In greedy mode (enabled by the greedy option), all consecutive whitespace chars (including \n) will be trimmed. Greedy mode is enabled by default to be compliant with shopify/liquid.