【发布时间】:2015-09-20 13:46:47
【问题描述】:
我正在使用 Jekyll(没有博客)构建一个静态网站,只有页面。
我想找到一种方法来生成(自动或使用menu.yml 文件)菜单(如this website,在页脚上)。
我在页面的 YAML 中定义标题和章节属性:
---
layout: page
title: Title of the page
chapter: Title of the chapter
permalink: /title-of-the-chapter/title-of-the-chapter/
order: 3250
published: true
---
我想要这样的菜单:
<ul>
<li>Title of the chapter</li>
<ul>
<li><a href="permalink">Title of the page</a></li>
</ul>
</ul>
顺便说一下,我的文件是这样组织在文件夹中的:
01-chapter-one
01-subchapter-one
index.md
02-subchapter-two
index.md
02-chapter-one
01-subchapter-one
index.md
是否有解决方案(可能没有插件)自动执行此操作(我有很多页面)?
【问题讨论】: