2016-10-01 28 views
0

我想服务一个/manfest.json文件 - 它有一些android的图标信息。Wintersmith的服务/manifest.json

{ 
    "name": "woot.io", 
    "icons": [ 
     { 
      "src": "\/android-chrome-192x192.png", 
      "sizes": "192x192", 
      "type": "image\/png" 
     }, 
     { 
      "src": "\/android-chrome-512x512.png", 
      "sizes": "512x512", 
      "type": "image\/png" 
     } 
    ], 
    "theme_color": "#0d87e9", 
    "display": "standalone" 
    } 

当我把文件放在/ contents中时,Wintersmith将它渲染到/manifest.html。不好。

有了这个/contents/manifest.json:

{ 
    "template": "manifest.jade", 
    "filename": "manifest.json" 
} 

使用模板,但我还没有发现语法让玉输出JSON。有没有更好的办法?我觉得我错过了一些更容易的事情。

回答

1

好吧,我发现了一个解决方案:

内容/ manifest.md

--- 
template: manifest.jade 
filename: manifest.json 
--- 

模板/ manifest.jade

|{ 
| "name": "woot.io", 
| "icons": [ 
|  { 
|   "src": "\/android-chrome-192x192.png", 
|   "sizes": "192x192", 
|   "type": "image\/png" 
|  }, 
|  { 
|   "src": "\/android-chrome-512x512.png", 
|   "sizes": "512x512", 
|   "type": "image\/png" 
|  } 
| ], 
| "theme_color": "#0d87e9", 
| "display": "standalone" 
|}