Skip to content

Commit 05da530

Browse files
committed
Bugfix for hidden patterns with docs
1 parent 29f55cc commit 05da530

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/PatternLab/PatternData/Exporters/PatternPartialsExporter.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ public function run($type = "", $subtype = "") {
4747
$suffixRendered = Config::getOption("outputFileSuffixes.rendered");
4848

4949
foreach ($this->store as $patternStoreKey => $patternStoreData) {
50-
51-
if (($patternStoreData["category"] == "pattern") && isset($patternStoreData["hidden"]) && (!$patternStoreData["hidden"]) && (!$patternStoreData["noviewall"]) && ($patternStoreData["depth"] > 1) && (!in_array($patternStoreData["type"],$this->styleGuideExcludes))) {
50+
51+
$canShow = isset($patternStoreData["hidden"]) && (!$patternStoreData["hidden"]) && (!$patternStoreData["noviewall"]);
52+
53+
if (($patternStoreData["category"] == "pattern") && $canShow && ($patternStoreData["depth"] > 1) && (!in_array($patternStoreData["type"],$this->styleGuideExcludes))) {
5254

5355
if ((($patternStoreData["type"] == $type) && empty($subtype)) || (empty($type) && empty($subtype)) || (($patternStoreData["type"] == $type) && ($patternStoreData["subtype"] == $subtype))) {
5456

@@ -102,7 +104,7 @@ public function run($type = "", $subtype = "") {
102104

103105
}
104106

105-
} else if (($patternStoreData["category"] == "pattern") && (isset($patternStoreData["full"]) && ($type === $patternStoreData["full"] || $type === ""))) {
107+
} else if (($patternStoreData["category"] == "pattern") && $canShow &&(isset($patternStoreData["full"]) && ($type === $patternStoreData["full"] || $type === ""))) {
106108
// This is for `patternType` docs. Given this structure:
107109
// - _patterns/
108110
// - atoms/

0 commit comments

Comments
 (0)