简体   繁体   中英

How do I use Jekyll in a subdirectory?

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, ie, 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM