Description #
Liquid is a lightweight, open-source templating language used to render dynamic content in web applications and static site generators. It’s known for its logic-less syntax and safe rendering, making it ideal for platforms like Shopify and Jekyll.
History #
Liquid was created in 2006 by Tobias Lütke, the founder of Shopify. It was developed to allow merchants and developers to safely customize themes without exposing core application logic. Over time, Liquid became widely adopted in static site generators and CMS platforms for its balance of flexibility and security.
Hello World Code #
<h1>{{ "Hello, World!" }}</h1>
How to Run #
Option 1: Online
Try it in a Jekyll-based playground like https://jekyllrb.com/docs/liquid/
Option 2: Local
Install Ruby & Jekyll:
gem install jekyll bundler
jekyll new my-site
cd my-site
jekyll serve
Use {{ "Hello, World!" }}
inside any .html
or .md
file within your Jekyll project.
Key Concepts #
- Logic-less templating syntax
- Interpreted at runtime
- Secure output escaping
- Filters for data manipulation
- Tags for control flow (
if
,for
, etc.) - Used in static site generators (Jekyll)
- Embedded in hosted platforms (Shopify)
- Variable assignment via
{% assign %}
- Extensible via custom filters/tags
- Platform-safe: limits malicious logic execution
Try It Online #
https://shopify.github.io/liquid
Fun Facts #
- The name “Liquid” emphasizes its role in shaping dynamic content fluidly.
- Shopify themes and countless Jekyll blogs are powered by Liquid templates.
- Many CMS platforms use Liquid for safe user-generated template customization.
Resources #
Official site
Docs or tutorial
GitHub or interpreter
Community or learning resources