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

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 …
100 Websites You Only Need on the Internet
·1402 words·7 mins· loading
Data Science Resources Data Science Artificial Intelligence Developer Tools AI Tools Productivity Tools Online Learning
100 Websites You Only Need on the Internet # The internet has billions of pages. Most of them are …
The AI Leadership Playbook: A Reusable Workflow Template
·939 words·5 mins· loading
Business & Career Artificial Intelligence Career Development AI Integration Generative AI Future of Work
The AI Leadership Playbook: A Reusable Workflow Template # Part 7 of the Human Skills, AI-Expanded …
Agentic AI for Business Leaders: When Agents Help and When They Do Not
·967 words·5 mins· loading
Artificial Intelligence Business & Career Technology Trends & Future Career Development AI Integration Generative AI Future of Work
Agentic AI for Business Leaders: When Agents Help and When They Do Not # Part 6 of the Human …
AI for Technology Executives: Scenarios and Prompts
·1169 words·6 mins· loading
Business & Career Artificial Intelligence Technology Trends & Future Career Development AI Integration Generative AI Cybersecurity
AI for Technology Executives: Scenarios and Prompts # Part 5 of the Human Skills, AI-Expanded …