@@ -132,7 +132,7 @@ |
||
| 132 | 132 | $this->options = array_merge([ |
| 133 | 133 | 'drafts' => false, // build drafts or not |
| 134 | 134 | 'dry-run' => false, // if dry-run is true, generated files are not saved |
| 135 | - 'page' => '', // specific page to build |
|
| 135 | + 'page' => '', // specific page to build |
|
| 136 | 136 | ], $options); |
| 137 | 137 | |
| 138 | 138 | // process each step |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | public function process(): void |
| 57 | 57 | { |
| 58 | 58 | /** @var Page $page */ |
| 59 | - $filteredPages = $this->builder->getPages()->filter(function (Page $page) { |
|
| 59 | + $filteredPages = $this->builder->getPages()->filter(function(Page $page) { |
|
| 60 | 60 | return !empty($page->getVariable('rendered')); |
| 61 | 61 | }); |
| 62 | 62 | $max = count($filteredPages); |
@@ -13,14 +13,14 @@ discard block |
||
| 13 | 13 | 'title' => 'Site title', |
| 14 | 14 | //'baseline' => 'Site baseline', |
| 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' => 'Site description', |
| 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' => [ |
@@ -155,17 +155,17 @@ discard block |
||
| 155 | 155 | 'format' => 'yaml', |
| 156 | 156 | ], |
| 157 | 157 | 'body' => [ |
| 158 | - 'format' => 'md', // page body format (only Markdown is supported) |
|
| 158 | + 'format' => 'md', // page body format (only Markdown is supported) |
|
| 159 | 159 | 'toc' => ['h2', 'h3'], // headers used to build the table of contents |
| 160 | 160 | 'images' => [ |
| 161 | 161 | 'lazy' => [ |
| 162 | - 'enabled' => true, // enables lazy loading (`true` by default) |
|
| 162 | + 'enabled' => true, // enables lazy loading (`true` by default) |
|
| 163 | 163 | ], |
| 164 | 164 | 'caption' => [ |
| 165 | 165 | 'enabled' => false, // adds <figcaption> to images with a title (`false` by default) |
| 166 | 166 | ], |
| 167 | 167 | 'remote' => [ |
| 168 | - 'enabled' => true, // enables remote image handling (`true` by default) |
|
| 168 | + 'enabled' => true, // enables remote image handling (`true` by default) |
|
| 169 | 169 | ], |
| 170 | 170 | 'resize' => [ |
| 171 | 171 | 'enabled' => false, // enables image resizing by using the `width` extra attribute (`false` by default) |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | ], |
| 179 | 179 | ], |
| 180 | 180 | 'notes' => [ |
| 181 | - 'enabled' => false, // enables Notes blocks (`false` by default) |
|
| 181 | + 'enabled' => false, // enables Notes blocks (`false` by default) |
|
| 182 | 182 | ], |
| 183 | 183 | ], |
| 184 | 184 | // data files |
@@ -206,17 +206,17 @@ discard block |
||
| 206 | 206 | ], |
| 207 | 207 | 'assets' => [ |
| 208 | 208 | 'dir' => 'assets', |
| 209 | - 'compile' => [ // Compile Saas |
|
| 209 | + 'compile' => [// Compile Saas |
|
| 210 | 210 | 'enabled' => true, |
| 211 | 211 | 'style' => 'expanded', // 'expanded' or 'compressed', |
| 212 | 212 | 'import' => ['sass', 'scss', 'node_modules'], |
| 213 | 213 | 'sourcemap' => false, // works in debug mode only |
| 214 | 214 | //'variables' => ['var' => 'value'] |
| 215 | 215 | ], |
| 216 | - 'minify' => [ // Minify CSS and JS |
|
| 216 | + 'minify' => [// Minify CSS and JS |
|
| 217 | 217 | 'enabled' => true, |
| 218 | 218 | ], |
| 219 | - 'fingerprint' => [ // Add fingerprint |
|
| 219 | + 'fingerprint' => [// Add fingerprint |
|
| 220 | 220 | 'enabled' => true, |
| 221 | 221 | ], |
| 222 | 222 | 'target' => 'assets', // target directory of remote and resized assets |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | 'optimize' => [ |
| 225 | 225 | 'enabled' => false, // enables images optimization with JpegOptim, Optipng, Pngquant 2, SVGO 1, Gifsicle, cwebp (`false` by default) |
| 226 | 226 | ], |
| 227 | - 'quality' => 75, // Image quality after optimization or resize (`75` by default) |
|
| 227 | + 'quality' => 75, // Image quality after optimization or resize (`75` by default) |
|
| 228 | 228 | 'responsive' => [ |
| 229 | 229 | 'enabled' => false, // creates responsive images with `html` filter (`false` by default) |
| 230 | 230 | 'widths' => [480, 640, 768, 1024, 1366, 1600, 1920], |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $generatorManager = new GeneratorManager($this->builder); |
| 47 | 47 | |
| 48 | 48 | // loads local generators |
| 49 | - spl_autoload_register(function ($className) { |
|
| 49 | + spl_autoload_register(function($className) { |
|
| 50 | 50 | $generatorFile = Util::joinFile($this->config->getSourceDir(), 'generators', "$className.php"); |
| 51 | 51 | if (file_exists($generatorFile)) { |
| 52 | 52 | require $generatorFile; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | }); |
| 55 | 55 | |
| 56 | 56 | $generators = (array) $this->builder->getConfig()->get('generators'); |
| 57 | - array_walk($generators, function ($generator, $priority) use ($generatorManager) { |
|
| 57 | + array_walk($generators, function($generator, $priority) use ($generatorManager) { |
|
| 58 | 58 | if (!class_exists($generator)) { |
| 59 | 59 | $message = \sprintf('Unable to load generator "%s".', $generator); |
| 60 | 60 | $this->builder->getLogger()->error($message); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $this->builder = $builder; |
| 69 | 69 | $this->config = $builder->getConfig(); |
| 70 | 70 | $paths = is_array($paths) ? $paths : [$paths]; |
| 71 | - array_walk($paths, function ($path) { |
|
| 71 | + array_walk($paths, function($path) { |
|
| 72 | 72 | if (empty($path)) { |
| 73 | 73 | throw new RuntimeException('The path parameter of "asset() can\'t be empty."'); |
| 74 | 74 | } |
@@ -81,10 +81,10 @@ discard block |
||
| 81 | 81 | 'ext' => '', // file extension |
| 82 | 82 | 'type' => '', // file type (e.g.: image, audio, video, etc.) |
| 83 | 83 | 'subtype' => '', // file media type (e.g.: image/png, audio/mp3, etc.) |
| 84 | - 'size' => 0, // file size (in bytes) |
|
| 84 | + 'size' => 0, // file size (in bytes) |
|
| 85 | 85 | 'content_source' => '', // file content, before transformations |
| 86 | 86 | 'content' => '', // file content, after transformations |
| 87 | - 'width' => 0, // width (in pixels) in case of an image |
|
| 87 | + 'width' => 0, // width (in pixels) in case of an image |
|
| 88 | 88 | ]; |
| 89 | 89 | |
| 90 | 90 | // handles options |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | |
| 415 | 415 | try { |
| 416 | 416 | $img = ImageManager::make($assetResized->data['content_source']); |
| 417 | - $img->resize($width, null, function (\Intervention\Image\Constraint $constraint) { |
|
| 417 | + $img->resize($width, null, function(\Intervention\Image\Constraint $constraint) { |
|
| 418 | 418 | $constraint->aspectRatio(); |
| 419 | 419 | $constraint->upsize(); |
| 420 | 420 | }); |
@@ -119,8 +119,7 @@ |
||
| 119 | 119 | $this->url = (string) new self($this->builder, $page, $options); |
| 120 | 120 | break; |
| 121 | 121 | // asset as string |
| 122 | - case false !== strpos($value, '.') ? true : false: |
|
| 123 | - $this->url = $base.'/'.ltrim($value, '/'); |
|
| 122 | + case false !== strpos($value, '.') ? true : false : $this->url = $base.'/'.ltrim($value, '/'); |
|
| 124 | 123 | break; |
| 125 | 124 | // others cases? |
| 126 | 125 | default: |