diff --git a/src/Resume/Command/HtmlCommand.php b/src/Resume/Command/HtmlCommand.php index 7af2d48a..e8e42d84 100644 --- a/src/Resume/Command/HtmlCommand.php +++ b/src/Resume/Command/HtmlCommand.php @@ -35,7 +35,7 @@ protected function configure() 'template', 't', InputOption::VALUE_REQUIRED, - 'Which of the templates to use' + 'Which of the templates to use. Use an absolute path for a custom template.' ) ->addOption( 'refresh', @@ -102,6 +102,10 @@ protected function generateContent($templatePath, $contentType) array_push($assets, new FileAsset($fileInfo->getPathname())); } + usort($assets, function(FileAsset $a, FileAsset $b){ + return strcmp($a->getSourcePath(), $b->getSourcePath()); + }); + $collection = new AssetCollection( $assets ); @@ -126,7 +130,13 @@ protected function generateHtml($source, $template, $refresh) if (!$template) { $template = $this->app->defaultTemplate; } - $templatePath = join(DIRECTORY_SEPARATOR, array($this->app->templatePath, basename($template))); + + if (strpos($template, DIRECTORY_SEPARATOR) !== false) { + $templatePath = realpath($template); + } else { + $templatePath = join(DIRECTORY_SEPARATOR, array($this->app->templatePath, basename($template))); + } + $templateIndexPath = join(DIRECTORY_SEPARATOR, array($templatePath, 'index.html')); if (!file_exists($templateIndexPath)) {