diff --git a/core/config/config.ini.default b/core/config/config.ini.default index 25fa0ec..5ef75ef 100644 --- a/core/config/config.ini.default +++ b/core/config/config.ini.default @@ -43,4 +43,10 @@ styleGuideExcludes = "" cacheBusterOn = "true" // the pattern rending engine -patternEngine = "mustache" \ No newline at end of file +patternEngine = "mustache" + +// the public directory +publicDir = "public" + +// the source directory +sourceDir = "source" \ No newline at end of file diff --git a/core/lib/PatternLab/Builder.php b/core/lib/PatternLab/Builder.php index 0312b15..946b9ad 100644 --- a/core/lib/PatternLab/Builder.php +++ b/core/lib/PatternLab/Builder.php @@ -26,6 +26,12 @@ class Builder { exit; } + // set-up the source & public dirs + $this->sp = "/../../../".$config["sourceDir"]."/_patterns".DIRECTORY_SEPARATOR; + $this->pp = "/../../../".$config["publicDir"]."/patterns".DIRECTORY_SEPARATOR; + $this->sd = __DIR__."/../../../".$config["sourceDir"]; + $this->pd = __DIR__."/../../../".$config["publicDir"]; + // populate some standard variables out of the config foreach ($config as $key => $value) { @@ -64,12 +70,6 @@ class Builder { } - // set-up the source & public dirs - $this->sp = "/../../../source/_patterns".DIRECTORY_SEPARATOR; - $this->pp = "/../../../public/patterns".DIRECTORY_SEPARATOR; - $this->sd = __DIR__."/../../../source"; - $this->pd = __DIR__."/../../../public"; - // provide the default for enable CSS. performance hog so it should be run infrequently $this->enableCSS = false; $this->patternCSS = array(); @@ -281,8 +281,9 @@ class Builder { protected function generateViewAllPages() { // make sure $this->mfs & $this->mv are refreshed on each generation of view all - $this->loadMustacheFileSystemLoaderInstance(); - $this->loadMustacheVanillaInstance(); + $templateLoader = new TemplateLoader(); + $this->mfs = $templateLoader->fileSystem(); + $this->mv = $templateLoader->vanilla(); // add view all to each list $i = 0; $k = 0;