0

ここからすべての手順を実行しました:

1) シンプルなプラグイン /plugins/myplugin/myplugin.plugin.coffee を次のコードで作成しました:

module.exports = (BasePlugin) ->
  class MyPlugin extends BasePlugin
    name: 'myplugin'
    renderBefore: ({templateData}) ->
      templateData.foo = 'bar'

2) /plugins/myplugin/package.json

{
  "name": "myplugin",
  "version": "2.0.0",
  "main": "./src/myplugin.plugin.coffee"
}

3) /src/documents/index.html.eco

<p><%= @foo %></p>

しかし、プラグインは機能しません。DocPad のログinfo: Plugins: ecoに記録されず、エラーがスローされますReferenceError: foo is not defined

私は何を取りこぼしたか?

4

1 に答える 1