Say you have a site example.com
running on jekyll and you want example.com/blog
to also be served from the same jekyll setup, here is what you need to do :
cd ~/example.com
-> Root dir.cd _includes
-> Add ablogskin.html
that would contain all the required css and js.cd _layouts
and create ablog
layout that each of your blog posts will use, don't forget toIncluded file 'blogskin.html' not found in _includes directory
mkdir blog
-> This would be the index forexample.com/blog
and hence must contain theindex.html
static file, listing all the blog posts, similar to an index file thatjekyll new
would generate, have alayout: blog
so that index and the blog posts look and feel remains in sync.echo "permalink: /blog/:title.html" >> _config.yml
-> This would be premalink format for your blog posts.
Now, a jekyll build && jekyll server
must have example.com/blog
serving your blog :-)
Hope this helps, not sure if a bash script to do this will help more, will decide after some feedback ;)
This was a part of my learning gained while preparing yeoman's team blog.
@GNUmanth good notes! Thanks for helping us get the setup right for yeoman.io.
— Addy Osmani (@addyosmani) August 25, 2013