@@ -13,14 +13,14 @@ |
||
| 13 | 13 | 'title' => 'My Website', |
| 14 | 14 | 'baseline' => 'My amazing static website!', |
| 15 | 15 | 'baseurl' => 'http://localhost:8000/', |
| 16 | - 'canonicalurl' => false, // if true 'url()' function preprends URL wirh 'baseurl' |
|
| 16 | + 'canonicalurl' => false, // if true 'url()' function preprends URL wirh 'baseurl' |
|
| 17 | 17 | 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', |
| 18 | - 'taxonomies' => [ // default taxonomies |
|
| 18 | + 'taxonomies' => [// default taxonomies |
|
| 19 | 19 | 'tags' => 'tag', // can be disabled with 'disabled' value |
| 20 | 20 | 'categories' => 'category', |
| 21 | 21 | ], |
| 22 | 22 | 'pagination' => [ |
| 23 | - 'max' => 5, // number of pages on each paginated pages |
|
| 23 | + 'max' => 5, // number of pages on each paginated pages |
|
| 24 | 24 | 'path' => 'page', // path to paginated pages. ie: '/blog/page/2/' |
| 25 | 25 | ], |
| 26 | 26 | 'date' => [ |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | $message = sprintf('"%s": no config file', $theme); |
| 45 | 45 | if (Util::getFS()->exists($themeConfigFile)) { |
| 46 | 46 | set_error_handler( |
| 47 | - function ($severity, $message, $file, $line) { |
|
| 47 | + function($severity, $message, $file, $line) { |
|
| 48 | 48 | throw new \ErrorException($message, 0, $severity, $file, $line, null); |
| 49 | 49 | } |
| 50 | 50 | ); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | public static function joinPath(string ...$path): string |
| 139 | 139 | { |
| 140 | - array_walk($path, function (&$value) { |
|
| 140 | + array_walk($path, function(&$value) { |
|
| 141 | 141 | $value = str_replace('\\', '/', $value); |
| 142 | 142 | $value = rtrim($value, '/'); |
| 143 | 143 | }); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public static function joinFile(string ...$path): string |
| 156 | 156 | { |
| 157 | - array_walk($path, function (&$value) { |
|
| 157 | + array_walk($path, function(&$value) { |
|
| 158 | 158 | $value = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $value); |
| 159 | 159 | $value = rtrim($value, DIRECTORY_SEPARATOR); |
| 160 | 160 | }); |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | // filters pages: home, sections and terms |
| 32 | - $filteredPages = $this->pagesCollection->filter(function (Page $page) { |
|
| 32 | + $filteredPages = $this->pagesCollection->filter(function(Page $page) { |
|
| 33 | 33 | return in_array($page->getType(), [Type::HOMEPAGE, Type::SECTION, Type::TERM]); |
| 34 | 34 | }); |
| 35 | 35 | /** @var Page $page */ |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public function generate(): void |
| 25 | 25 | { |
| 26 | - $subPages = $this->pagesCollection->filter(function (Page $page) { |
|
| 26 | + $subPages = $this->pagesCollection->filter(function(Page $page) { |
|
| 27 | 27 | return $page->getType() == TYPE::PAGE |
| 28 | 28 | && $page->getId() != 'index'; // excludes homepage |
| 29 | 29 | }); |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | public function setMessageCallback(\Closure $messageCallback = null): void |
| 286 | 286 | { |
| 287 | 287 | if ($messageCallback === null) { |
| 288 | - $messageCallback = function ($code, $message = '', $itemsCount = 0, $itemsMax = 0) { |
|
| 288 | + $messageCallback = function($code, $message = '', $itemsCount = 0, $itemsMax = 0) { |
|
| 289 | 289 | switch ($code) { |
| 290 | 290 | case 'CONFIG': |
| 291 | 291 | case 'LOCATE': |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | public function getLog(int $type = 0): ?array |
| 400 | 400 | { |
| 401 | 401 | if (is_array($this->log)) { |
| 402 | - return array_filter($this->log, function ($key) use ($type) { |
|
| 402 | + return array_filter($this->log, function($key) use ($type) { |
|
| 403 | 403 | return $key['type'] <= $type; |
| 404 | 404 | }); |
| 405 | 405 | } |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | public function filterBy(PagesCollection $pages, string $variable, string $value): CollectionInterface |
| 126 | 126 | { |
| 127 | - $filteredPages = $pages->filter(function (Page $page) use ($variable, $value) { |
|
| 127 | + $filteredPages = $pages->filter(function(Page $page) use ($variable, $value) { |
|
| 128 | 128 | $notVirtual = false; |
| 129 | 129 | if (!$page->isVirtual()) { |
| 130 | 130 | $notVirtual = true; |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | */ |
| 167 | 167 | public function sortByWeight(\Traversable $collection): array |
| 168 | 168 | { |
| 169 | - $callback = function ($a, $b) { |
|
| 169 | + $callback = function($a, $b) { |
|
| 170 | 170 | if (!isset($a['weight'])) { |
| 171 | 171 | return 1; |
| 172 | 172 | } |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | public function sortByDate(\Traversable $collection): array |
| 197 | 197 | { |
| 198 | - $callback = function ($a, $b) { |
|
| 198 | + $callback = function($a, $b) { |
|
| 199 | 199 | if (!isset($a['date'])) { |
| 200 | 200 | return -1; |
| 201 | 201 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | // collects published pages |
| 60 | 60 | /** @var Page $page */ |
| 61 | - $filteredPages = $this->builder->getPages()->filter(function (Page $page) { |
|
| 61 | + $filteredPages = $this->builder->getPages()->filter(function(Page $page) { |
|
| 62 | 62 | return !empty($page->getVariable('published')); |
| 63 | 63 | }); |
| 64 | 64 | $max = count($filteredPages); |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | } |
| 286 | 286 | $rendered = preg_replace_callback( |
| 287 | 287 | '/href="([A-Za-z0-9_\.\-\/]+)\.md(\#[A-Za-z0-9\-]+)?"/is', |
| 288 | - function ($matches) use ($replace) { |
|
| 288 | + function($matches) use ($replace) { |
|
| 289 | 289 | return \sprintf($replace, Page::slugify(PrefixSuffix::sub($matches[1])), $matches[2] ?? ''); |
| 290 | 290 | }, |
| 291 | 291 | $rendered |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | call_user_func_array($this->builder->getMessageCb(), ['SAVE', 'Saving pages']); |
| 48 | 48 | |
| 49 | 49 | /** @var Page $page */ |
| 50 | - $filteredPages = $this->builder->getPages()->filter(function (Page $page) { |
|
| 50 | + $filteredPages = $this->builder->getPages()->filter(function(Page $page) { |
|
| 51 | 51 | return !empty($page->getVariable('rendered')); |
| 52 | 52 | }); |
| 53 | 53 | $max = count($filteredPages); |