Skip to content

grunt-assemble withSort stops working #64

@maekke97

Description

@maekke97

Hi,
I'm not sure if this is the correct place to post this, please redirect me if I'm wrong.
We have a grunt setup to create our api documentation (http://api.meteomatics.com).
The main content pages have a handlebar header as follows:

---
title: Overview
sortOrder: 0
---

Our news blog entries like so:

---
title: "Model Output Statistics (MOS) is now available in our API" # 'to change' - Title for news blog always inside of ""
posted: "2018-04-06T12:00Z" # 'to change' - Posted Date (Format YYYY-MM-DDTHH:mmZ) UTC Time
linkforid: "2018-04-06Mos" # 'to change' - Link to scroll to this news blog, has to be unique
notInNav: true # 'keep this' - it hides the news blog in the side navigation, but it is still in the News tab
post: true # 'keep this if' - true shows this news blog, false hide it
---

Then we build our navbar using #withSort:

<ul class="nav navbar-nav">
  {{#isnt page.data.notInNav true}}
    {{#withSort  pages 'data.sortorder'}}
      {{#isnt data.notInNav true}}
        <li {{#is ../../page.dest this.dest}} class="active"{{/is}}><a href="{{filename}}" >{{data.title}}{{#is pagename "Search.html"}}<span style="float:right; margin-right: 30px;">&#128269;</span>{{/is}}</a>
        </li>
      {{/isnt}}
    {{/withSort}}
  {{else}}
    {{#withSort  pages 'data.sortorder'}}
      {{#isnt data.notInNav true}}
        <li  {{#is ../../page.title 'Available Parameters'}}
          {{#is this.dest "dest/Available-Parameters.html"}}
          class="active"
          {{/is}}
          {{/is}}><a href="{{filename}}" >{{data.title}}
        </li>
      {{/isnt}}
    {{/withSort}}
{{/isnt}}
</ul>

(I removed some content to make the example smaller)
This works all fine with up to 41 input pages. As soon as I add the 42nd (The 10th news blog entry), the sorting breaks and the navigation is in alphabetical order.

Does anyone have an Idea, what this could be?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions