【发布时间】:2018-03-01 14:25:25
【问题描述】:
我正在尝试在 GH Pages 上填充我的小型博客。我被 Jekyll 分页卡住了。
这是我的_config.yml:
theme: jekyll-theme-cayman
title: iBug @ GitHub
url: https://ibug.github.io/
tagline: The small personal site for iBug
description: The small personal site for iBug
author: iBug
show_downloads: false
plugins:
- jekyll-paginate
- jekyll-redirect-from
- jekyll-mentions
- jekyll-seo-tag
paginate: 5
paginate_path: "/blog/page:num/"
这是那里唯一帖子的内容:
---
layout: blog
permalink: /p/1
---
# Test Post
Nothing here
我想要/blog 上的分页索引页面,以及/blog/page# 上的后续页面(其中# 是一个数字)。我复制了一个示例 index.html 并将其放在我的仓库中的 /blog/index.html。
但是当我导航到 https://ibug.github.io/blog 时,它只是显示如下:
{% if paginator.total_pages > 1 %} {% if paginator.previous_page %} « Prev {% else %} « Prev {% endif %} {% for page in (1..paginator.total_pages) %} {% if page == paginator.page %} {{ page }} {% elsif page == 1 %} {{ page }} {% else %} {{ page }} {% endif %} {% endfor %} {% if paginator.next_page %} @ 987654325@ {% else %} 下一个 » {% endif %} {% endif %}
阅读 GH 文档后,我了解到 jekyll-paginate 是默认插件,无法禁用,因此它不应该以这种方式工作。
我在/_posts/2018-03-01-first-post.md 也有一个虚拟帖子,它正确显示在https://ibug.github.io/2018/03/01/first-post
我不想安装 Ruby 开发环境和其他东西。我只想使用 GH Pages 的内置功能。
我可以在/blog 和/blog/pageN 获得索引吗?
【问题讨论】:
标签: jekyll github-pages jekyll-paginator