1

というわけで、nanocを試してみます。

出力フォルダーを github の gh-pages にアップロードしました。

css でスタイルを表示するのに問題があります。

filter :relativize_paths, :type => :cssルールを追加してみました。

再度コンパイルしました。

まだ正しく表示されません。

私は何を間違っていますか?

ページが正しく表示されていないことがわかります: http://arubyist.github.io/nanoc/

これはルールページです:

compile '*' do
   if item[:extension] == 'css'
   # don’t filter stylesheets
 elsif item.binary?
 # don’t filter binary items
 else
   filter :erb
   layout 'default'
 end
end

 route '*' do
 if item[:extension] == 'css'
 # Write item with identifier /foo/ to /foo.css
 item.identifier.chop + '.css'
 elsif item.binary?
 # Write item with identifier /foo/ to /foo.ext
 item.identifier.chop + '.' + item[:extension]
else
# Write item with identifier /foo/ to /foo/index.html
item.identifier + 'index.html'
 end
 end

 layout '*', :erb

 compile '/html' do 
   filter :relativize_paths, :type => :html
  end 

 compile '/css' do
   filter :relativize_paths, :type => :css 
  end 
4

2 に答える 2

0

これを機能させるには、フィルタをコンパイル ルールの最後に配置する必要があります。html の場合は、レイアウト ステートメントのに配置する必要があります。例:

コンパイル '*' do
  if item[:extension] == 'css'
    フィルター :relativize_paths, :type => :css
  elsif item.binary?
    # バイナリ アイテムをフィルタリングしない
  そうしないと
    フィルター:クラムダウン
    フィルター:erb
    レイアウト「デフォルト」
    フィルター :relativize_paths, :type => :html
  終わり
終わり
于 2015-01-16T13:33:14.207 に答える