Hemanth's Scribes

web

Jekyll Blog from a Subdirectory

Author Photo

Hemanth HM

Thumbnail

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:
    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.

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

#jekyll#cli
Author Photo

About Hemanth HM

Hemanth HM is a Sr. Machine Learning Manager at PayPal, Google Developer Expert, TC39 delegate, FOSS advocate, and community leader with a passion for programming, AI, and open-source contributions.