JSON没有使用Panini加载

时间:2016-09-27 01:46:38

标签: javascript json node.js handlebars.js zurb-foundation

我正在使用Zurb Foundation for Emails,我希望创建一个非常简单的多语言电子邮件导出系统,我有data/lang.json

{
  "en": {
        "hello": "hello",
        "welcome": "Welcome to my website"
  },
  "fr": {
          "hello": "Bonjour",
          "other": "Bienvenue sur mon site web"
  }
}

..并基于lang

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">属性

我需要使用JSON中的相应对象。

Zurb使用Panini和Handlebars,所以我这样做是为了开始:

{{lang.en.hello}}

..但页面上没有任何内容。我做错了什么?

1 个答案:

答案 0 :(得分:3)

很可能在第50行的gulpfile.babel.js中缺少src / data目录。

Intent stop_intent = new Intent("just.some.random.fixed.string");
PendingIntent stop_pi = PendingIntent.getBroadcast(context, NUM, stop_intent, PendingIntent.FLAG_CANCEL_CURRENT);

NotificationCompat.Builder notif = new NotificationCompat.Builder(this)
    ...
    .addAction(0, "CANCEL", stop_pi);

如果您希望浏览器重新加载功能正常工作,您还应该添加其他人的监视表达式(在ln:106左右):

.pipe(panini({
      root: 'src/pages',
      layouts: 'src/layouts',
      partials: 'src/partials',
      helpers: 'src/helpers',
      data: 'src/data'

另见https://github.com/zurb/panini

祝你好运!