---
title: "Jekyll Blog from a Subdirectory"
description: "Serving a Jekyll blog from a subdirectory like example.com/blog. Practical notes and code examples on Jekyll Blog from a."
url: "https://h3manth.com/scribe/jekyll-blog-from-a-subdirectory/"
canonical_url: "https://h3manth.com/scribe/jekyll-blog-from-a-subdirectory/"
markdown_url: "https://h3manth.com/scribe/blog/jekyll-blog-from-a-subdirectory.md"
publishDate: "2013-08-25T00:00:00.000Z"
author: "Hemanth HM"
category: "web"
tags: ["jekyll","cli"]
word_count: 88
reading_time_minutes: 1
x_markdown_tokens: 246
content_signal: "ai-train=yes, search=yes, ai-input=yes"
---

# Jekyll Blog from a Subdirectory

> Serving a Jekyll blog from a subdirectory like example.com/blog. Practical notes and code examples on Jekyll Blog from a.

Serve `example.com/blog` from the same Jekyll setup as `example.com`:

1. `cd ~/example.com` → Root dir
2. `cd _includes` → Add `blogskin.html` with CSS/JS
3. `cd _layouts` → Create `blog` layout that includes `blogskin.html`
4. `mkdir blog` → Create index for `/blog` with `layout: blog`
5. Add permalink format:
   ```bash
   echo "permalink: /blog/:title.html" >> _config.yml
   ```

Now `jekyll build && jekyll server` will serve `example.com/blog`!

This was learned while preparing [Yeoman's team blog](http://yeoman.io/blog/).

> "@GNUmanth good notes! Thanks for helping us get the setup right for yeoman.io." — @addyosmani
