Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...