1

I'm using nanoc to build a static website which has a PHP script for sending mails. Simplified structure:

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

However, when I do a nanoc compile everything is fine in my output folder:

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

But I can't call the PHP script when doing a nanoc autocompile. /contact/ works, but /mail/ does not.

This is a part of my Rules-file:

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 is treated as non-binary. Does anyone know how I can get this to work with autocompile?

acme
  • 14,654
  • 7
  • 75
  • 109

1 Answers1

1

If anybody is having similar problems: I found the answer:

The autocompiler does not have support for PHP files. If a directory is requested, the autocompiler looks for an index.html file in it, but it will ignore an index.php file. The autocompiler can’t find a MIME type for it, so it sends the file as application/octet-stream back to the browser.

It's pretty obvious, but I did not have in mind that autocompile runs a light-weight server with no PHP support (of course).

acme
  • 14,654
  • 7
  • 75
  • 109