Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use Jekyll in a subdirectory?

Tags:

http

jekyll

Jekyll assumes that the generated site will be served from the root directory, and subsequently all of the links are absolute beginning with "/". I'd like to serve out a blog from a subdirectory, i.e., http://www.example.com/~user/blog.

Setting permalink variable (http://jekyllrb.com/docs/permalinks/) would be a partial fix, but doesn't address other things such as css files.

I'll be glad for any pointers.

like image 799
Michael Avatar asked May 19 '13 14:05

Michael


People also ask

What is the _site folder in Jekyll?

This is where the generated site will be placed (by default) once Jekyll is done transforming it.

Where do I put pictures in Jekyll?

Create /assets/images/ in the root of your project and place the image there. And if you're not hosting with GitHub Pages you can use the Jekyll Post Files plugin which allows you to organize your images alongside your posts. Don't use underscores in your folder names.


1 Answers

You want to use the baseurl config option in your _config.yml file. Permalinks will then be relative to that. See the Jekyll docs for the baseurl option: http://jekyllrb.com/docs/configuration/

Assuming you are using at least Jekyll 1.0.0.

like image 85
J W Avatar answered Oct 02 '22 15:10

J W