I think you'll still have to pull the variables from JSON global object or an array. But I'd love to hear about any other solutions, not using metadata, too.
using Pug (Jade), from this thread:
- var items = { home : 'Home', about: 'About', account: 'Account' }
ul
- for item, path in items
li
a(href="/" + path) #{item}
using EJS, using two arrays with the same length:
<nav>
<% for (item in urls, titles) { %>
<a href="<%= urls[item] %>">
<span class="menu-item"><%= titles[item] %></span>
</a>
<% } %>
</nav>
global harp.json:
{
"globals": {
"titles": [
"post title 1",
"post title 2",
"post title 3"
],
"urls": [
"post-title-1",
"post-title-2",
"post-title-custom-url"
]
}
}
Please, also take a look at the current object: http://harpjs.com/docs/development/current