Skip to content

Commit 480205f

Browse files
committed
smarter handling of styleguidekit files being missing
1 parent 81a1bc2 commit 480205f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/PatternLab/Template.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ public static function init() {
4848

4949
// load pattern-lab's resources
5050
$partialPath = $styleguideKitPath."/views/partials";
51-
self::$htmlHead = file_get_contents($partialPath."/general-header.".$patternExtension);
52-
self::$htmlFoot = file_get_contents($partialPath."/general-footer.".$patternExtension);
51+
$generalHeaderPath = $partialPath."/general-header.".$patternExtension;
52+
$generalFooterPath = $partialPath."/general-footer.".$patternExtension;
53+
self::$htmlHead = (file_exists($generalHeaderPath)) ? file_get_contents($generalHeaderPath) : "";
54+
self::$htmlFoot = (file_exists($generalFooterPath)) ? file_get_contents($generalFooterPath) : "";
5355

5456
// gather the user-defined header and footer information
5557
$patternHeadPath = $sourceDir."/_meta/_00-head.".$patternExtension;

0 commit comments

Comments
 (0)