|
Post by account_disabled on Jan 8, 2024 4:57:17 GMT
(查看大图) 文件夹名称必须以_(下划线)字符开头,以便 Jekyll 知道如何处理它们。 制作一些物体我们首先要做的就是我们的人民。我们将使用 Markdown 创建这些文件,这样它们就会变得漂亮、干净,但仍然生成正确的语义 HTML。你可以看到我已经为美国历史人物制作了一些文件(这可能与我连续一个月不间断地听汉密尔顿有关,也可能无关): 窗口显示添加到人员集合中的每个人员对象的文件。 Mac OS X Finder 窗口显示添加到人员集合中的每个人员对象的文件。(查看大图) 我们将在一个人的文件中放入的属性是: --- object-id: first-name: last-name: job: listing-priority: wikipedia-url: --- 复制 稍后我们将使用object-id来特指这些对象中的。 任何一个。我们将拆分名字和姓氏,以便我们可以选择在不同位置使用哪个组合(如果您的系统需要这样做),并且我们将使用job它来定义它们的用途。(我避免使用“标题”,因为这已经是 Jekyll 中页面默认具有的一个变量。)我还包含了一个用于列出优先级的属 Whatsapp 号码列表 性,这将允许我根据突发奇想对每个人进行排序,但您也可以按一些内置方法,例如字母或数字。最后,我们有一个用于链接到该人的维基百科页面的字段。 所有这些都包含在顶部和底部的三个连字符之间,将其定义为。每个简介的内容将遵循 YAML,并且可以是任意数量和结构的 HTML(但我们将使用 Markdown 格式来保持一切整洁)。 一个完全填充的 person 对象如下所示(为了清晰起见,内容被截断):复制 这个有一些区别。我设置。 了一个featured属性。如果一个项目被推荐,那么它就会被列在主页上。所有项目都将在项目页面上列出。我们还为每个展示位置设置了首选排序顺序。我们还提供了对创建该项目的人员的引用id,以便我们稍后可以直接引用他们。 主体:120+ 原生 React UI 组件与 Next.js 完全兼容 尝试 KENDOREACT 从我们的对象生成页面通过更改我的_config.yml文件,我可以为每个对象创建页面。 复制 对每个集合进行设置output: true会导致为其内部的每个对象生成一个页面。但是因为我们的对象的文件中没有内容,所以它们当前不输出任何数据,这意味着我们只会得到空页面。让我们构建一个布局模板来为我们做到这一点。 该文件将位于_layouts文件夹中。但首先,我们需要处理一个default.html文件。这将保留。
|
|