是Panini #ifequal可以评估对象'这个'?

时间:2017-03-18 19:21:36

标签: handlebars.js zurb-foundation

我使用ZURB基金会网站模板。

我真的无法找到问题所在,无法确定是否"这个"可以传递给助手#ifequal(帕尼尼)。代码所在的部分:

        {{#each @root.content}}
          {{#ifequal @key @../key}}
              {{@key}}-{{this}} this output the right key and string 'import-fragment'
            {{#ifequal this 'import-fragment'}} but never evaluate it equal to true?
              {{@key}}-{{this}} nothing here and never call this partial
              {{> fragment-router sub-segment-obj=../this }}
            {{else}}
              all works well from here
              {{> main-content sub-segment-obj=../this }}
            {{/ifequal}}
          {{/ifequal}}
        {{/each}}

正如您在代码中看到的那样,我无法获得字符串' import-fragment' =到真{{#ifequal this 'import-fragment'}}即使它是评估的正确字符串。这是我将内容放在Front Matter YAML格式中的页面:

---
  category: marketing

  content:
  ###################################### SECTION ########################################## 

    web-stats: import-fragment # why this doesn't equal import-fragment???

  # all following this works
    web-stats-in-page-way:
      sub-sections:

  ################### ARTICLE #######################      

        First article:
  ...

有人能看到我错过的东西吗?

提前谢谢你。我会回报下一个。

0 个答案:

没有答案