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

Quantum Measurement, Randomness, and Everyday Technology
·778 words·4 mins· loading
Interdisciplinary Topics Research & Academia Quantum Physics Quantum Mechanics Quantum Computing Interdisciplinary Topics
Quantum Measurement, Randomness, and Everyday Technology # This is Part 2 of Learning Quantum …
AI Agents as First-Class Citizens: Why Managing the Digital Workforce Is the Next HR Challenge
·2607 words·13 mins· loading
Artificial Intelligence Business & Career Technology Trends & Future AI Integration Future of Work AI Governance Organizational Design Generative AI
AI Agents as First-Class Citizens # Why Managing the Digital Workforce Is the Next HR Challenge …
When Consciousness Becomes Cosmos: Fields, Particles, Matter, and the Emergence of Size
·5741 words·27 mins· loading
Philosophy & Cognitive Science Interdisciplinary Topics Quantum Field Theory Consciousness Physics Advaita Vedanta Philosophy of Mind Emergence Metaphysics
When Consciousness Becomes Cosmos # From Consciousness to Cosmos: Fields, Particles, Matter, and …
Occam's Razor: Why the Simplest Explanation Often Wins
·994 words·5 mins· loading
Philosophy & Cognitive Science Interdisciplinary Topics Data Science Occam's Razor Critical Thinking Scientific Method Simplicity Decision Making Machine Learning Software Development
Occam’s Razor: Why the Simplest Explanation Often Wins # Prefer fewer assumptions until the …
From Claw Code to Clean Room: A Developer's Guide to Re-implementing Software Without Getting Sued
·2854 words·14 mins· loading
AI Ethics & Governance Software Development Technology Trends & Future Clean Room Design Intellectual Property AI Code Generation Software Copyright Trade Secrets Software Development
From Claw Code to Clean Room: A Developer’s Guide to Re-implementing Software Without Getting …