0

ベースパスフィルターの書き換え?

webbyのベースパスフィルターを使用して、プロジェクト内のすべてのURLを書き換えようとしています。

Webbyのベースパスフィルターに関するドキュメントは、これに関して少し「軽い」ものであり、使用方法を理解するのに十分ではありません。

ただし、これに対する解決策が見つかった場合は、プロジェクトにいくつかのドキュメントを提供する予定です。

また、これが機能するためには、「/」で始まるように書き換えるURLへのすべてのパスが必要であることも理解しています。

このようにフィルターをdefault.txtテンプレートに適用してみました...

---
extension: html
filter:    erb
       basepath
---

**-レイアウトの先頭/default.txt**

次に、次のコマンドを実行します。

leeand00@someHost: webby rebuild BASE='http://www.yahoo.com/bob/'

**-プロジェクトのルートディレクトリからコマンドを実行します**

しかし、私が得るのはエラーだけです...

** Invoke rebuild (first_time)
** Invoke configure_basepath (first_time)
** Execute configure_basepath
** Execute rebuild
webby aborted!
syntax error on line 4, col 0: `---'
/usr/lib/ruby/1.8/yaml.rb:133:in `load'
/usr/lib/ruby/1.8/yaml.rb:133:in `load'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/resources/meta_file.rb:164:in `meta_data'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/resources/meta_file.rb:51:in `meta_data'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/resources/meta_file.rb:51:in `open'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/resources/meta_file.rb:51:in `meta_data'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/resources/layout.rb:19:in `initialize'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/resources.rb:41:in `new'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/resources.rb:41:in `new'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/builder.rb:167:in `load_files'
/usr/lib/ruby/1.8/find.rb:39:in `find'
/usr/lib/ruby/1.8/find.rb:38:in `catch'
/usr/lib/ruby/1.8/find.rb:38:in `find'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/builder.rb:164:in `load_files'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/builder.rb:134:in `run'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/builder.rb:23:in `run'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/tasks/build.rake:13
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:615:in `call'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:615:in `execute'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/apps/main.rb:232:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/apps/main.rb:115:in `rake'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/apps/main.rb:33:in `run'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/apps/main.rb:12:in `run'
/var/lib/gems/1.8/gems/webby-0.9.3/bin/webby:39
/var/lib/gems/1.8/bin/webby:19:in `load'
/var/lib/gems/1.8/bin/webby:19
leeand00@U101:~/J62$ webby --trace rebuild BASE='http://www.yahoo.com/bob/'
** Invoke rebuild (first_time)
** Invoke configure_basepath (first_time)
** Execute configure_basepath
** Execute rebuild
webby aborted!
syntax error on line 4, col 0: `---'
/usr/lib/ruby/1.8/yaml.rb:133:in `load'
/usr/lib/ruby/1.8/yaml.rb:133:in `load'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/resources/meta_file.rb:164:in `meta_data'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/resources/meta_file.rb:51:in `meta_data'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/resources/meta_file.rb:51:in `open'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/resources/meta_file.rb:51:in `meta_data'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/resources/layout.rb:19:in `initialize'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/resources.rb:41:in `new'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/resources.rb:41:in `new'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/builder.rb:167:in `load_files'
/usr/lib/ruby/1.8/find.rb:39:in `find'
/usr/lib/ruby/1.8/find.rb:38:in `catch'
/usr/lib/ruby/1.8/find.rb:38:in `find'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/builder.rb:164:in `load_files'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/builder.rb:134:in `run'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/builder.rb:23:in `run'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/tasks/build.rake:13
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:615:in `call'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:615:in `execute'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/apps/main.rb:232:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/apps/main.rb:115:in `rake'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/apps/main.rb:33:in `run'
/var/lib/gems/1.8/gems/webby-0.9.3/lib/webby/apps/main.rb:12:in `run'
/var/lib/gems/1.8/gems/webby-0.9.3/bin/webby:39
/var/lib/gems/1.8/bin/webby:19:in `load'
/var/lib/gems/1.8/bin/webby:19
4

2 に答える 2

1

有効な webby 構文を使用するように、フィルター セクションを変更してみてください。次のようになります。

---
extension: html
filter:
  - erb
  - basepath
---
于 2009-02-25T18:22:09.460 に答える