【问题标题】:Includes folder in a middleman app?在中间人应用程序中包含文件夹?
【发布时间】:2018-05-17 21:59:34
【问题描述】:

我继承了一个中间人静态页面存储库的存储库,它有一个 includes 文件夹和一个文件中的一些奇怪的降价语法。该文件位于此处:root/folder1/thing.index.md:

---
title: some app

toc_footers:
  - © thing3

search: true

includes:

- orders/introduction
- orders/active/examples

- footer
---

我有这些文件:root/includes/orders/_introduction.mdroot/includes/orders/active/_examples.md

这是什么结构?我在middleman 项目的任何地方都找不到这种结构或语法? includes: 方法从何而来?

【问题讨论】:

    标签: middleman


    【解决方案1】:

    这些是Yaml Frontmatter 的示例。

    在这种情况下,current_page.data.includes 将指向一个包含两个条目的数组。 然后应该有代码可以处理这个includes 变量,例如使用<% current_page.data.includes.each do |filename| %> 之类的东西对其进行迭代。

    此代码将位于您的 repo 中或包含在 Middleman 项目中的某个 gem 中(例如,one)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-06
      • 1970-01-01
      • 2023-03-06
      • 1970-01-01
      • 2017-07-21
      • 2016-12-06
      • 2017-09-03
      • 2018-01-19
      相关资源
      最近更新 更多