jekyll - 如何配置 Jekyll 让 /blog 并排放置帖子和静态页面
问题描述
我需要在 /blog 目录中建立一个包含静态页面和博客的网站。我有一个带有 index.html 的自定义网站,它是主要入口点,我想在导航栏中添加 /blog。
到目前为止,我有这个:
_config.yaml:
permalink: "/blog/:title.html"
plugins: [jekyll-paginate]
paginate: 10
paginate_path: "/blog/page:num"
博客.md:
---
layout: default
title: LIPS Blog
permalink: /blog/
---
<p>This is blog</p>
{% for post in paginator.posts %}
<article>
<header>
<h2><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h2>
</header>
<div class="excerpt">
{{ post.content | split: '<!-- more -->' | first }}
</div>
</article>
{% endfor %}
我在_posts中有两个文件:
2020-11-22-web-worker-and-scheme-lisp.md
2021-05-01-LIPS-parser.md
/blog 已呈现,但分页器不起作用。我有一个警告:
分页:分页已启用,但我找不到 index.html 页面用作分页模板。跳过分页。
如何在 /blog 目录中为带有分页的帖子设置 Jekyll?
解决方案
推荐阅读
- asp.net - 在 ASP.Net MVC 中重定向时将带有 QueryString 的注册用户电子邮件发送到登录页面
- c# - 在 C# 中识别对 IP 地址的 ping 请求?
- javascript - 从php代码块调用带有php变量作为参数的javascript函数
- c++ - 为什么 std::vector::push_front() 不存在?
- c# - PromptDialog.Choice 之后的操作
- java - Spring Boot:无法实例化 [com.hazelcast.jet.JetInstance]
- c# - 如何在存储库模式中使用 lambda 连接表
- html - 添加到日历按钮/链接
- java - 如何序列标识符?
- swagger - OpenAPI 3.0 通用数据类型