Skip to main content
  1. Data Science Blog/

A Developer's Guide to Templating Engines

·448 words·3 mins· loading · ·
Web Development Templating Engines Jekyll Liquid Hugo Go Templates Web Development

A Developer’s Guide to Templating Engines
#

What is a Templating Engine?
#

A templating engine is a system used to generate dynamic HTML pages by combining a template with data. It’s used in static site generators (SSGs), web frameworks, and CMSs.

Templating engines can be confusing, especially when switching between site generators like Jekyll (Liquid) and Hugo (Go templates).

🔍 Common Templating Engines (and who uses them)
#

Templating EngineSyntax ExampleUsed ByLanguage
Liquid{\{ variable }\} / {\% raw %}{\% if %}{\% endraw %}Jekyll, ShopifyRuby
Go Templates{\{ .Variable }\} / {\% raw %}{\{ if . }\} {\% endraw %}HugoGo
Handlebars{\{variable}\} / {\{#if}\}Ember.js, Ghost, many JS toolsJavaScript
EJS<%= variable %> / <% if (...) { %>Express.js (Node)JavaScript
Mustache{\{variable}\}Many static generatorsLanguage-agnostic
Twig{\{ variable }\} / {\% raw %}{\% if %}{\% endraw %}Symfony (PHP), Grav CMSPHP
Jinja2{\{ variable }\} / {\% raw %}{\% if %} {\% endraw %}Flask (Python)Python
Nunjucks{\{ variable }\} / {\% raw %}{\% if %} {\% endraw %}Eleventy (JS SSG)JavaScript

💡 Key Differences Between Hugo (Go Templates) and Jekyll (Liquid)
#

FeatureJekyll (Liquid)Hugo (Go Templates)
Tag syntax{\{ variable }\} / {\% ... %}{\{ .Variable }\} / {\{ if ... }\}
Loops{\% for item in list %}{\{ range .List }\}
Conditions{\% if condition %}{\{ if .Condition }\}
Partial templates{\% include 'file.html' %}{\{ partial "file.html" . }\}
Data scopeIntuitive (like Ruby)Very strict (. = current context)
Error messagesFriendly-ishSometimes cryptic
ExtensibilityEasy with pluginsVery fast, limited customization
PerformanceSlower for big sitesBlazing fast

🧠 Why It Feels Confusing
#

  • {\{ ... }\} is common across many engines but means different things.
  • In Liquid, {\{ }\} is for output; {\% \%} is for logic.
  • In Hugo, everything is in {\{ }\} and the dot (.) matters a lot (.Title, .Params, etc.).
  • Hugo doesn’t use {\% raw \%-} — that’s Liquid-only. (remove -)
  • Each engine has its quirks and idioms — no true standard.

🧰 When to Use What?
#

Use CaseRecommended Engine
Simple blog, Markdown-focusedJekyll (Liquid) or Hugo
Fast builds with complex structureHugo (Go Templates)
Tight integration with JS frameworksNunjucks, Handlebars
Backend web frameworksJinja2 (Flask), Twig (Symfony), EJS (Express)
Cross-language portabilityMustache

🔄 Migrating Tips
#

When moving between engines (e.g., Jekyll → Hugo):

  • Strip all {\% raw %}, {\% endraw %}
  • Replace {\% include %} with {\{ partial }\}
  • Replace {\% for post in site.posts %} with {\{ range .Site.RegularPages }\} or similar
  • Be very careful with ., .Params, and context in Hugo

Related

The AI Market Ecosystem
·1150 words·6 mins· loading
Artificial Intelligence Technology Trends & Future Societal Impact AI Industry AI Economics Technology Policy Market Analysis AI Ethics
The AI Market Ecosystem # Who the Players Are, Who Earns, Who Spends, and What It Means for Human …
Accuracy Is Not a Number: How Customers Misjudge AI Document Processing
·2628 words·13 mins· loading
Artificial Intelligence AI Applications Evaluation & Metrics Document AI OCR Enterprise AI Model Evaluation Accuracy Metrics
Accuracy Is Not a Number # How Customers Misjudge AI Document Processing Many enterprise AI …
Experimenting with Vertex AI: A Practical Guide from Account Setup to First Model Call
·4895 words·23 mins· loading
Cloud Computing Artificial Intelligence Language Models (LLMs) Vertex AI Google Cloud Platform Gemini GCP Vertex AI Studio Model Garden IAM MLOps
Experimenting with Vertex AI: A Practical Guide from Account Setup to First Model Call # 1. …
Cursor Chat: Architecture, Data Flow & Storage
·1318 words·7 mins· loading
Artificial Intelligence Developer Tools Software Architecture Cursor IDE Cursor Chat AI Code Editor SQLite Turbopuffer Codebase Indexing RAG Semantic Search Data Flow Local Storage Composer
Cursor Chat: Architecture, Data Flow & Storage # This document explains how Cursor chat works …
Safeguarding PII When Using LLMs in Alternative Investment Banking
·4261 words·21 mins· loading
Artificial Intelligence Financial Technology Data Security & Privacy PII Protection LLM Privacy Alternative Investment Banking BFSI Data Privacy AI Compliance Differential Privacy Federated Learning Financial AI Security
Safeguarding PII When Using LLMs in Alternative Investment Banking # 1. Introduction # The …