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

Experimenting with Vertex AI: A Practical Guide from Account Setup to First Model Call
·4895 words·23 mins· loading
Cloud Computing Artificial Intelligence LLM 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 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 …
AI Hallucinations in BFSI - A Comprehensive Guide
·2975 words·14 mins· loading
Artificial Intelligence Financial Technology AI Hallucinations BFSI AI Implementation Financial AI Risk Management Banking AI Ethics RAG in Finance Knowledge Graphs BFSI LLM Risk Mitigation Financial AI Compliance
AI Hallucinations in the BFSI Domain - A Comprehensive Guide # Introduction # Artificial …
Roadmap to Reality
·990 words·5 mins· loading
Philosophy & Cognitive Science Interdisciplinary Topics Scientific Journey Self-Discovery Personal Growth Cosmic Perspective Human Evolution Technology Biology Neuroscience
Roadmap to Reality # A Scientific Journey to Know the Universe — and the Self # 🌱 Introduction: The …