2013-03-05 27 views
1

我使用nanoc來構建一個靜態網站,它有一個用於發送郵件的PHP腳本。簡化的結構:nanoc在自動編寫號中找不到我的PHP文件

/content/index.html 
/content/contact.html 
/content/mail.php 

然而,當我做了nanoc compile一切都在我的輸出文件夾罰款:

index.html 
contact/index.html 
mail/index.php 

但我不能做nanoc autocompile時調用PHP腳本。 /contact/作品,但/mail/沒有。

這是我的規則文件的一部分:

route '*' do 
    if item.binary? 
     # Write item with identifier /foo/ to /foo.ext 
     original_filename(item) 
    else 
     # Write item with identifier /foo/ to /foo/index.extension 
     item.identifier + "index.#{item[:extension]}" 
    end 
end 

PHP作爲非二進制處理。有誰知道我如何才能使用autocompile

回答

1

若有人有類似的問題:我發現answer

的autocompiler沒有對PHP文件的支持。如果請求目錄 ,自動編譯器會查找其中的index.html文件,但是 它將忽略index.php文件。自動編譯器無法找到它的MIME 類型,所以它將該文件作爲application/octet-stream發送回到瀏覽器的 。

這是非常明顯的,但我沒有記住autocompile運行輕量級服務器沒有PHP的支持(當然)。