| | |

GitHub Pages 03 ๐Ÿ“„ Jekyll & Asset Processing โ€” Understanding default builds, themes, Liquid templating, and the .nojekyll bypass

โฑ๏ธ Estimated read: 9 min | |

Jekyll is the native static site generator built into the heart of GitHub Pages. When GitHub Pages was first launched, it was essentially a hosting wrapper for Jekyll, allowing developers to convert Markdown and text files into a functional website without managing a web server. Even today, if you do not specify a custom workflow, GitHub attempts to build your repository using Jekyll, applying themes and processing Liquid tags to render your HTML.

However, the web development landscape has evolved. Modern frontend frameworks like React, Vue, and Svelte output their own static assets, which are often incompatible with Jekyllโ€™s processing rulesโ€”particularly its tendency to ignore directories beginning with an underscore. Understanding how to leverage Jekyll for documentation or blogging, and how to safely disable it when you are deploying a modern Single Page Application (SPA), is a fundamental skill for managing GitHub Pages deployments.

This chapter covers the inner workings of the Jekyll engine within the GitHub Pages environment, including the role of the _config.yml file, the use of Liquid templating for site structure, and the critical .nojekyll bypass mechanism. We will explore how these components interact to transform your raw content into a rendered website and how to exert control over that build process.

Key point: GitHub Pages defaults to the Jekyll engine to process your site, using Front Matter for metadata and Liquid for logic; you must explicitly use a .nojekyll file to disable this engine when deploying modern JavaScript frameworks that generate their own static assets.


Why X exists

The “Content-First” problem. Developers often want to write content in Markdown but serve it as a polished HTML website. Jekyll exists to bridge this gap, automatically converting readable text files into a standard website structure without requiring the developer to write repetitive HTML boilerplate.

The “DRY” (Don’t Repeat Yourself) problem. In raw HTML, creating a consistent navigation bar or footer requires copying and pasting code across every file. Jekyll solves this by introducing layouts and includes, allowing you to define a structure once and apply it to every page in your site dynamically.

The configuration management problem. Without a central configuration file, site settings like title, description, and base URL are hardcoded into HTML files. The _config.yml file provides a single source of truth for the entire siteโ€™s metadata, making updates trivial.

The asset processing conflict. Modern frameworks produce folders like _next (Next.js) or _app (Angular/Nuxt), which Jekyll traditionally treats as “hidden” or “system” folders because they start with an underscore. The .nojekyll file exists specifically to override the default build engine and prevent it from interfering with these pre-built assets.

The theme dependency problem. Creating a cohesive look and feel across a site is difficult. Jekyll themes allow users to import standardized design templates as “gems,” enabling a consistent look without requiring the user to write complex CSS or JavaScript from scratch.


a. Jekyll Architecture: Front Matter and Liquid

Jekyll uses “Front Matter” to handle page-specific data. Every file that Jekyll processes (usually .md or .html files) should start with a block of YAML enclosed in triple-dashed lines. This metadata informs the build engine about the layout to use, the title of the page, and any custom variables.

---
layout: post
title: "My Chapter Title"
author: "Developer"
---
# Content goes here

The second pillar of Jekyll is “Liquid,” a templating language that handles the logic. You will often see Liquid tags like {{ page.title }} to inject the data from the Front Matter, or {% include footer.html %} to inject reusable code snippets. Jekyll reads these tags and substitutes them with the corresponding values during the site generation process.

When you push your code, GitHub runs the Jekyll build. It creates a _site directory (which you don’t see) where it assembles all files, replaces the Liquid tags with HTML, and applies the defined layouts. This entire process happens on GitHub’s servers, meaning your repository remains clean of the build output.


b. Themes, Plugins, and Build Restrictions

Themes in GitHub Pages are distributed as Ruby gems. You define them in your _config.yml file, and GitHubโ€™s build server automatically downloads and applies them during the build phase. This allows you to apply professional-grade CSS and navigation structures simply by adding one line to your configuration file.

# _config.yml
theme: jekyll-theme-minimal
title: "My Project Site"

However, GitHub Pages runs Jekyll in a “safe mode” environment. This means you cannot install arbitrary Jekyll plugins (like those that modify the file system or run external scripts). Only a specific “allow-list” of plugins supported by GitHub is available. If your site requires complex plugins, you must build the site locally and push the resulting _site output to your repository, rather than relying on GitHub to perform the build.


c. The .nojekyll Bypass

The .nojekyll bypass is a safety mechanism. When you build a modern application locally (e.g., npm run build), your output folder typically contains files like bundle.js, _next, or .css. Jekyll interprets files or folders starting with an underscore as system files to be ignored or processed differently. This often results in your CSS or JavaScript assets being completely omitted from the final deployed site.

Creating an empty file named .nojekyll in the root of your deployment directory forces GitHub Pages to skip the Jekyll build process entirely. It tells GitHub: “Treat this repository as a collection of static files and serve them exactly as they are.”

# How to add the bypass
touch .nojekyll
git add .nojekyll
git commit -m "Disable Jekyll to support SPA assets"

This is mandatory for any project built with React, Vue, Angular, or any toolchain that produces its own production-ready static output. If you fail to include this file, your site will likely appear without styles or interactivity because the build engine is stripping away your critical frontend assets.


Complete Example Session

// ============================================
// PART 1: A STANDARD JEKYLL CONFIG
// ============================================
// _config.yml
title: "My Portfolio"
theme: jekyll-theme-cayman
markdown: kramdown

// ============================================
// PART 2: THE FRONT MATTER
// ============================================
// index.md
---
layout: default
title: "Welcome"
---
# {{ page.title }}

Hello, this is my site.

// ============================================
// PART 3: THE LAYOUT FILE
// ============================================
// _layouts/default.html
<html>
  <body>
    <h1>{{ site.title }}</h1>
    {{ content }}
  </body>
</html>

// ============================================
// PART 4: THE INCLUDES (REUSABLE COMPONENT)
// ============================================
// _includes/footer.html
<footer>
  <p>ยฉ 2024 My Site</p>
</footer>

// ============================================
// PART 5: THE INJECTION
// ============================================
// _layouts/default.html (updated)
...
{{ content }}
{% include footer.html %}

// ============================================
// PART 6: PREPARING A MODERN SPA
// ============================================
// Structure for a React build (output of npm run build)
/dist
  /assets
    index.js
    style.css
  index.html
  .nojekyll

// ============================================
// PART 7: THE BYPASS FILE
// ============================================
// .nojekyll (empty file)

// ============================================
// PART 8: DEPLOYMENT SETTINGS
// ============================================
// Source: Deploy from branch
// Branch: main (or gh-pages)
// Folder: /dist

// ============================================
// PART 9: THE .GITIGNORE FOR JEKYLL
// ============================================
// Don't commit the build output if building on GH
_site/
.sass-cache/

// ============================================
// PART 10: VERIFYING THE BUILD
// ============================================
// Pushing to GitHub triggers the build action
// View the build logs in the "Actions" tab

The parts above walked through the anatomy of a Jekyll-powered site (Front Matter, Layouts, Includes) and the contrast with a modern build process requiring the .nojekyll file.


Quick Reference

Jekyll File Components

FilePurpose
_config.ymlGlobal site settings
_layouts/Templates for pages
_includes/Reusable snippets
index.mdContent with Front Matter

Liquid Syntax

SyntaxDescription
{{ var }}Output variable
{% tag %}Execute logic
{{ site.title }}Site metadata
{{ content }}Page body content

Deployment Control

ActionFileResult
Enable JekyllNo fileAutomatic build
Disable Jekyll.nojekyllStatic raw delivery
Ignore.gitignoreExclude build folders

Best Practices

โœ… Do This:

# Add a .nojekyll file for React/Vue apps               // โœ…
# Keep _config.yml at the root                          // โœ…
# Use Front Matter to manage page titles                // โœ…
# Use _includes for shared navigation elements          // โœ…
# Use .gitignore to hide local _site folders            // โœ…

โŒ Don’t Do This:

# Use custom Jekyll plugins (they won't run)            // โŒ
# Name folders starting with '_' in SPAs               // โŒ
# Hardcode site titles in every HTML file              // โŒ
# Forget the .nojekyll file for build frameworks       // โŒ
# Store secret API keys in _config.yml                 // โŒ

Common Pitfalls

PitfallWhy It HappensFix
CSS not loadingJekyll processing assetsAdd .nojekyll
404 on assetsJekyll ignoring underscoresAdd .nojekyll
Missing layoutIncorrect layout keyVerify _layouts exists
Plugin errorUsing non-whitelisted pluginBuild locally, push static
Broken linksBase URL configurationSet baseurl in config

Real-World Examples

1. Blog using Jekyll

Uses _posts folder and layout: post to generate chronological articles.

2. Documentation using Docsify

Uses .nojekyll to serve purely static HTML files from docs/.

3. React SPA

Uses GitHub Actions to build code into dist/ and a .nojekyll file to allow routing.

4. Minimal Portfolio

Uses jekyll-theme-minimal in _config.yml with no custom CSS.

5. API Reference

Uses a custom _layout file to wrap Markdown generated documentation.

6. Personal Resume

Single index.html file using Liquid to inject variables from _config.yml.

7. VuePress Site

Requires .nojekyll because VuePress creates _app folders.

8. Project Wiki

Uses _includes for a sidebar navigation present on all pages.

9. Open Source Landing Page

Uses Front Matter to set permalink: /custom-url/.

10. Legacy Site

Uses standard Jekyll build for a site created 5 years ago.


Visual

The Jekyll Build Engine

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  INPUT FILES (Markdown + Liquid)             โ”‚
โ”‚  โ”œโ”€โ”€ _config.yml                             โ”‚
โ”‚  โ”œโ”€โ”€ _layouts/                               โ”‚
โ”‚  โ””โ”€โ”€ index.md                                โ”‚
โ”‚          โ”‚                                   โ”‚
โ”‚          โ–ผ                                   โ”‚
โ”‚  JEKYLL BUILD ENGINE (GitHub Servers)        โ”‚
โ”‚          โ”‚                                   โ”‚
โ”‚          โ–ผ                                   โ”‚
โ”‚  OUTPUT (HTML + CSS + JS)                    โ”‚
โ”‚  โ””โ”€โ”€ /_site (Served to User)                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The .nojekyll Bypass

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  BUILD ARTIFACTS (React/Vue/Angular)         โ”‚
โ”‚  โ”œโ”€โ”€ .nojekyll  โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ SKIP JEKYLL       โ”‚
โ”‚  โ”œโ”€โ”€ index.html                              โ”‚
โ”‚  โ”œโ”€โ”€ /_next     โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ PROTECTED         โ”‚
โ”‚  โ””โ”€โ”€ main.js                                 โ”‚
โ”‚          โ”‚                                   โ”‚
โ”‚          โ–ผ                                   โ”‚
โ”‚  SERVED DIRECTLY TO USER                     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Directory Processing Logic

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  JEKYLL PROCESSING RULES                     โ”‚
โ”‚                                              โ”‚
โ”‚  - Files starting with '_' are ignored/      โ”‚
โ”‚    reserved for layout/data.                 โ”‚
โ”‚                                              โ”‚
โ”‚  - .nojekyll present?                        โ”‚
โ”‚    YES โ”€โ”€โ–บ Serve everything raw.             โ”‚
โ”‚    NO  โ”€โ”€โ–บ Process via Jekyll engine.        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Summary

ItemValue
Jekyll EngineRuby-based static generator
Metadata blockFront Matter (---)
Template LogicLiquid ({{ }})
Config file_config.yml
Plugin statusSafe mode (limited)
Bypass file.nojekyll
Use Case (Jekyll)Blogs, Docs, Landing pages
Use Case (.nojekyll)React, Vue, SPAs

Key takeaways:

  • Jekyll is the default engine. GitHub automatically treats repositories as Jekyll sites unless told otherwise.
  • Front Matter is metadata. It defines the page structure and variables via a YAML block at the top of the file.
  • Liquid enables logic. Use tags like {{ }} and {% %} to inject data and structure without writing repetitive HTML.
  • GitHub Pages restricts plugins. You cannot install arbitrary Ruby gems; you are restricted to a safe, pre-approved list.
  • .nojekyll is a mandatory override. For any project using modern JavaScript frameworks that create their own static build output, this file is essential to prevent GitHub from corrupting the file structure.

Remember: Jekyll provides powerful templating and site management tools for content-heavy sites, but it is an “opinionated” engine that expects a specific directory structure. When your project architecture clashes with Jekyll’s rulesโ€”especially regarding files starting with underscoresโ€”the .nojekyll file is the switch that returns control to your own build pipeline.

Was this helpful?


Stop using slow, ad-bloated tool sites! ๐Ÿคฎ

๐Ÿ”Ž Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
โœ… Finance (Mortgage, Interest, Inflation)
โœ… Tech (Base64, JSON, Dev Suite, IP)
โœ… Health (BMI, BMR, TDEE)
โœ… Productivity (Timer, Workspace, QR)

โšก๏ธ Fast & Private
๐Ÿ”’ No data leaves your device
๐Ÿ’Ž 100% Free

๐Ÿ”— Use it now: https://tools.kandz.me
๐Ÿ”– Bookmark itโ€”youโ€™ll need it later!