Jekyll分页博客作为子目录

use*_*368 3 blogs pagination subdirectory jekyll

我正在使用Jekyll作为静态站点,我正在尝试将博客生成为子目录/子文件夹:

http://example.com/blog
Run Code Online (Sandbox Code Playgroud)

在运行jekyll之前的目录结构中,这是blog/index.html.

我尝试通过在_config.yml中添加"paginate:5"来添加分页,但生成的url的格式如下:

http://example.com/page2/
Run Code Online (Sandbox Code Playgroud)

即没有"/博客".这是由以下修复:

paginate_path:/ blog/page /:num

在_config.yml中.

但结果生成的页面位于:

http://example.com/blog/page/2/
Run Code Online (Sandbox Code Playgroud)

不要使用blog/index.html作为他们的布局.他们使用root index.html.那么即使拥有paginate_path选项有什么意义呢?

如何使用Jekyll在example.com/blog上使用分页获取我的博客?

Ala*_*ith 5

使用destination_config.yml文件中的键设置要将输出发布到的基本路径.例如,

paginate: 5
destination: _site/blog
Run Code Online (Sandbox Code Playgroud)

请注意,假设您的站点设置为服务器,其根目录(例如" http://example.com/ ")来自"_site",jekyll将不会在该位置生成"index.html"页面.jekyll构建的所有内容都将位于"博客"目录下,但这听起来就像您所追求的那样.