Closed lyzadanger closed 9 years ago
Neat! (I'm not reviewing, just commenting.)
:+1:
This PR looks good to me, as this would be a useful helper. That said, I'm slightly confused about the overall necessity for it and how it relates to https://github.com/cloudfour/fabricator/issues/3
It seemed like the strategy for custom ordering was going to be implementing a front-matter order
property to sort on (possibly with a template helper to sort the array based on that key).
Are we instead going to rely on file naming? That's fine if the first option seems overly difficult, just trying to make sure I didn't miss something here.
items
are already sorted when they get to the template layer. That order happens to be filesystem ordering. I thought it would be a lot easier to do it this way than try to implement an ordering mechanism. The ordering will always be correct, and we only need to make the display name nice in the places where it gets rendered. It also allows for ordering by filename, which I think is easier than maintaining the values of order
in front matter across a bunch of files.
This PR introduces a new Handlebars helper that can allow us to do custom ordering of patterns the way we did on VSE.
You can now name patterns prefixed with
ddd-
for ordering, e.g.01-hi.html
and they will display in the nav menu with prettier names. The helperdisplayName
is available to any fabricator template now.