Fixed compilation of created pages

This commit is contained in:
Stéphane Goetz 2015-08-06 22:05:17 +02:00
parent 2f5abb8488
commit 01df221476
2 changed files with 3 additions and 2 deletions

BIN
daux.phar

Binary file not shown.

View File

@ -40,7 +40,8 @@ class ContentTypeHandler
*/
public function getType(Content $node)
{
$extension = pathinfo($node->getPath(), PATHINFO_EXTENSION);
$path = $node->getPath() ?: $node->getName();
$extension = pathinfo($path, PATHINFO_EXTENSION);
foreach ($this->types as $type) {
if (in_array($extension, $type->getExtensions())) {
@ -48,6 +49,6 @@ class ContentTypeHandler
}
}
throw new \RuntimeException("no contentType found for {$node->getPath()}");
throw new \RuntimeException("no contentType found for $path");
}
}