如何在子目录中使用Jekyll? [英] How do I use Jekyll in a subdirectory?
问题描述
Jekyll假设生成的站点将从根目录提供,随后所有链接都以/开头。我想从子目录中提供一个博客,即 http://www.example.com/~user/blog
。
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
.
设置永久链接
变量( http ://jekyllrb.com/docs/permalinks/ )将是部分修复,但不解决其他问题,如css文件。
Setting permalink
variable (http://jekyllrb.com/docs/permalinks/) would be a partial fix, but doesn't address other things such as css files.
I任何指针都会很高兴。
I'll be glad for any pointers.
推荐答案
你想在你的 baseurl 配置选项中使用_config.yml文件。永久链接将与此相关。有关 baseurl 选项,请参阅Jekyll文档:
http:// jekyllrb。 com / docs / configuration /
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/
假设您使用的是至少Jekyll 1.0.0。
Assuming you are using at least Jekyll 1.0.0.
这篇关于如何在子目录中使用Jekyll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!