Skip to content

Commit ca457f5

Browse files
committed
Fix for patternType docs
1 parent 05da530 commit ca457f5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/PatternLab/PatternData/Exporters/PatternPartialsExporter.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ public function run($type = "", $subtype = "") {
4848

4949
foreach ($this->store as $patternStoreKey => $patternStoreData) {
5050

51+
// Docs for patternTypes (i.e. `atoms.md`), don't have these rules and need them to pass below conditionals
52+
if (
53+
!isset($patternStoreData['depth'])
54+
&& !isset($patternStoreData['hidden'])
55+
&& !isset($patternStoreData['noviewall'])
56+
) {
57+
$patternStoreData["hidden"] = false;
58+
$patternStoreData["noviewall"] = false;
59+
$patternStoreData["depth"] = 0;
60+
}
5161
$canShow = isset($patternStoreData["hidden"]) && (!$patternStoreData["hidden"]) && (!$patternStoreData["noviewall"]);
5262

5363
if (($patternStoreData["category"] == "pattern") && $canShow && ($patternStoreData["depth"] > 1) && (!in_array($patternStoreData["type"],$this->styleGuideExcludes))) {
@@ -104,7 +114,7 @@ public function run($type = "", $subtype = "") {
104114

105115
}
106116

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

0 commit comments

Comments
 (0)