-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding to MD docs Yaml meta settings: hidden, noviewall that work. Ad…
…ding for future use: order, tags, links. (#137)
- Loading branch information
1 parent
d703ad2
commit 69c5471
Showing
1 changed file
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,12 +80,24 @@ public function run($depth, $ext, $path, $pathName, $name) { | |
"meta" => $yaml, | ||
"full" => $doc); | ||
|
||
// can set `title: My Cool Pattern` instead of lifting from file name | ||
if (isset($title)) { | ||
$patternStoreData["nameClean"] = $title; | ||
} | ||
|
||
if (isset($yaml["state"])) { | ||
$patternStoreData["state"] = $yaml["state"]; | ||
$availableKeys = [ | ||
'state', // can use `state: inprogress` instead of `[email protected]` | ||
'hidden', // setting to `true`, removes from menu and viewall, which is same as adding `_` prefix | ||
'noviewall', // setting to `true`, removes from view alls but keeps in menu, which is same as adding `-` prefix | ||
'order', // @todo implement order | ||
'tags', // not implemented, awaiting spec approval and integration with styleguide kit. adding to be in sync with Node version. | ||
'links', // not implemented, awaiting spec approval and integration with styleguide kit. adding to be in sync with Node version. | ||
]; | ||
|
||
foreach ($availableKeys as $key) { | ||
if (isset($yaml[$key])) { | ||
$patternStoreData[$key] = $yaml[$key]; | ||
} | ||
} | ||
|
||
// if the pattern data store already exists make sure this data overwrites it | ||
|