nanogen icon indicating copy to clipboard operation
nanogen copied to clipboard

"Front matter" in partials

Open xsorifc28 opened this issue 6 years ago • 0 comments

If i have partials/menu.ejs, I figured I should be able to use "front matter" there such that:

---
menuItems:
  - Item 1
  - Item 2
  - Item 3
---

would be available, e.g.:

<% if (partial.menuItems.tags) { %>
  <% partial.menuItems.forEach(function(item) { %>
    <span><%= item %></span>
  <% }) %>
<% } %>

Alternatively..since "menu" is site wide I could make the "menuItems" available in site.config.js.

Thought it would be a good nice-to-have though...assuming it's not complicated since page already implements this.

xsorifc28 avatar Feb 23 '19 22:02 xsorifc28