私が理解しないこと:特定のキーワードはDocPadの@documentのように予約されているように見えますが、この言葉でカスタムデータ値を使用できますか?基本的なDocPad:変数と最初のエラー
私は
<%= data.hostimagesurl %>
を使用していますが、私は使用しても
<%= page.hostimagesurl %>
と
<%= site.hostimagesurl %>
を見てきました、私はこれらを作ることができますか?私が使用しなければならない価値がありますか?
私は落とし穴をどこで見つけることができないのですか?ハイフンとアンダースコアは許可されていますか?
私はこれがハンドルバーのように機能していると想像しています。私は値を入力してタグを定義しています。これは正しい考えですか?
私のDocPadレイアウトが機能しない理由も混乱します。
---
title: "Welcome!"
layout: "default"
isPage: true
hostimagesurl: "http://www.googel.com/"
---
<p>Testing 1</p>
何に:
background-image:url(<%= data.hostimagesurl %>bg.gif);
<body style="padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;min-width:100%; color:#353535; background-color:#f9f9f9; background-image:url(<%= data.hostimagesurl %>bg.gif); background-repeat: repeat; background-position:center top; font-family: Helvetica, sans-serif; font-size:13px; margin: 0; padding: 0;" yahoo="fix" bgcolor="#f9f9f9">
はindex.htmlファイルをレンダリングマイ次のようになります。私はちょうど私が見ることができる最初のエラーは、この行で発生
error: Something went wrong while rendering: /Users/***/my-new-website/src/render/index.html
The error follows:
ReferenceError: document is not defined
at Object.eval (<anonymous>:55:29)
at Object.eval (<anonymous>:67:8)
at eval (<anonymous>:69:6)
at Function.eco.render (/Users/***/my-new-website/node_modules/eco/lib/index.js:26:25)
at EcoPlugin.render (/Users/***/my-new-website/node_modules/docpad-plugin-eco/out/eco.plugin.js:23:32)
at ambi (/Users/***/my-new-website/node_modules/event-emitter-grouped/node_modules/ambi/out/lib/ambi.js:57:27)
at Task.<anonymous> (/Users/***/my-new-website/node_modules/event-emitter-grouped/out/lib/event-emitter-grouped.js:45:23)
at ambi (/Users/***/my-new-website/node_modules/ambi/es5/lib/ambi.js:98:14)
at Domain.fireMethod (/Users/***/my-new-website/node_modules/taskgroup/out/lib/taskgroup.js:397:23)
at Domain.run (domain.js:228:14)
at Task.fire (/Users/***/my-new-website/node_modules/taskgroup/out/lib/taskgroup.js:435:27)
at Immediate._onImmediate (/Users/***/my-new-website/node_modules/taskgroup/out/lib/taskgroup.js:452:26)
at processImmediate [as _immediateCallback] (timers.js:383:17)
がエラーを取得しています地球私は間違っている?
hostimagesurlがサイト全体の場合、templateData下にdocpad.coffeeスクリプトでそれを定義します:hostimagesurl:このような一般的なもの "http://www.googel.com/" と使う<% - @ hostimagesurl%>あなたのhtmlファイルにあります。レンダリングフォルダ内のindex.htmlファイルとそのファイルをレンダリングするためにindex.html.ecoという名前ですか? – user3257693