@@ -79,81 +79,81 @@ |
||
| 79 | 79 | ], |
| 80 | 80 | 'output' => [ |
| 81 | 81 | 'formats' => [ |
| 82 | - [ // e.g.: blog/post-1/index.html |
|
| 82 | + [// e.g.: blog/post-1/index.html |
|
| 83 | 83 | 'name' => 'html', |
| 84 | 84 | 'mediatype' => 'text/html', |
| 85 | 85 | 'filename' => 'index', |
| 86 | 86 | 'extension' => 'html', |
| 87 | 87 | ], |
| 88 | - [ // e.g.: blog/atom.xml |
|
| 88 | + [// e.g.: blog/atom.xml |
|
| 89 | 89 | 'name' => 'atom', |
| 90 | 90 | 'mediatype' => 'application/atom+xml', |
| 91 | 91 | 'filename' => 'atom', |
| 92 | 92 | 'extension' => 'xml', |
| 93 | 93 | 'exclude' => ['redirect', 'paginated'], |
| 94 | 94 | ], |
| 95 | - [ // e.g.: blog/rss.xml |
|
| 95 | + [// e.g.: blog/rss.xml |
|
| 96 | 96 | 'name' => 'rss', |
| 97 | 97 | 'mediatype' => 'application/rss+xml', |
| 98 | 98 | 'filename' => 'rss', |
| 99 | 99 | 'extension' => 'xml', |
| 100 | 100 | 'exclude' => ['redirect', 'paginated'], |
| 101 | 101 | ], |
| 102 | - [ // e.g.: blog.json |
|
| 102 | + [// e.g.: blog.json |
|
| 103 | 103 | 'name' => 'json', |
| 104 | 104 | 'mediatype' => 'application/json', |
| 105 | 105 | 'extension' => 'json', |
| 106 | 106 | 'exclude' => ['redirect'], |
| 107 | 107 | ], |
| 108 | - [ // e.g.: blog.xml |
|
| 108 | + [// e.g.: blog.xml |
|
| 109 | 109 | 'name' => 'xml', |
| 110 | 110 | 'mediatype' => 'application/xml', |
| 111 | 111 | 'extension' => 'xml', |
| 112 | 112 | 'exclude' => ['redirect'], |
| 113 | 113 | ], |
| 114 | - [ // e.g.: robots.txt |
|
| 114 | + [// e.g.: robots.txt |
|
| 115 | 115 | 'name' => 'txt', |
| 116 | 116 | 'mediatype' => 'text/plain', |
| 117 | 117 | 'extension' => 'txt', |
| 118 | 118 | 'exclude' => ['redirect'], |
| 119 | 119 | ], |
| 120 | - [ // e.g.: blog/post-1/amp/index.html |
|
| 120 | + [// e.g.: blog/post-1/amp/index.html |
|
| 121 | 121 | 'name' => 'amp', |
| 122 | 122 | 'mediatype' => 'text/html', |
| 123 | 123 | 'subpath' => 'amp', |
| 124 | 124 | 'filename' => 'index', |
| 125 | 125 | 'extension' => 'html', |
| 126 | 126 | ], |
| 127 | - [ // e.g.: sw.js |
|
| 127 | + [// e.g.: sw.js |
|
| 128 | 128 | 'name' => 'js', |
| 129 | 129 | 'mediatype' => 'application/javascript', |
| 130 | 130 | 'extension' => 'js', |
| 131 | 131 | ], |
| 132 | - [ // e.g.: manifest.webmanifest |
|
| 132 | + [// e.g.: manifest.webmanifest |
|
| 133 | 133 | 'name' => 'webmanifest', |
| 134 | 134 | 'mediatype' => 'application/manifest+json', |
| 135 | 135 | 'extension' => 'webmanifest', |
| 136 | 136 | ], |
| 137 | - [ // e.g.: atom.xsl |
|
| 137 | + [// e.g.: atom.xsl |
|
| 138 | 138 | 'name' => 'xsl', |
| 139 | 139 | 'mediatype' => 'application/xml', |
| 140 | 140 | 'extension' => 'xsl', |
| 141 | 141 | ], |
| 142 | - [ // e.g.: blog/feed.json |
|
| 142 | + [// e.g.: blog/feed.json |
|
| 143 | 143 | 'name' => 'jsonfeed', |
| 144 | 144 | 'mediatype' => 'application/json', |
| 145 | 145 | 'filename' => 'feed', |
| 146 | 146 | 'extension' => 'json', |
| 147 | 147 | 'exclude' => ['redirect', 'paginated'], |
| 148 | 148 | ], |
| 149 | - [ // e.g.: video/oembed.json |
|
| 149 | + [// e.g.: video/oembed.json |
|
| 150 | 150 | 'name' => 'oembed', |
| 151 | 151 | 'mediatype' => 'application/json+oembed', |
| 152 | 152 | 'filename' => 'oembed', |
| 153 | 153 | 'extension' => 'json', |
| 154 | 154 | 'exclude' => ['redirect', 'paginated'], |
| 155 | 155 | ], |
| 156 | - [ // e.g.: video/embed.html |
|
| 156 | + [// e.g.: video/embed.html |
|
| 157 | 157 | 'name' => 'embed', |
| 158 | 158 | 'mediatype' => 'text/html', |
| 159 | 159 | 'filename' => 'embed', |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | /** |
| 120 | 120 | * Adds navigation (next and prev) to each pages of a section. |
| 121 | 121 | */ |
| 122 | - protected function addNavigationLinks(PagesCollection $pages, string|null $sortBy = null, bool $circular = false): void |
|
| 122 | + protected function addNavigationLinks(PagesCollection $pages, string | null $sortBy = null, bool $circular = false): void |
|
| 123 | 123 | { |
| 124 | 124 | $pagesAsArray = $pages->toArray(); |
| 125 | 125 | if ($sortBy === null || $sortBy == 'date' || $sortBy == 'updated') { |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | * |
| 303 | 303 | * @return Asset |
| 304 | 304 | */ |
| 305 | - public function asset($path, array|null $options = null): Asset |
|
| 305 | + public function asset($path, array | null $options = null): Asset |
|
| 306 | 306 | { |
| 307 | 307 | if (!\is_string($path) && !\is_array($path)) { |
| 308 | 308 | throw new RuntimeException(\sprintf('Argument of "%s()" must a string or an array.', \Cecil\Util::formatMethodName(__METHOD__))); |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | * |
| 534 | 534 | * @throws RuntimeException |
| 535 | 535 | */ |
| 536 | - public function html(array $context, Asset|array $assets, array $attributes = [], array $options = []): string |
|
| 536 | + public function html(array $context, Asset | array $assets, array $attributes = [], array $options = []): string |
|
| 537 | 537 | { |
| 538 | 538 | $html = array(); |
| 539 | 539 | if (!\is_array($assets)) { |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | /** |
| 1067 | 1067 | * Hashing an object, an array or a string (with algo, md5 by default). |
| 1068 | 1068 | */ |
| 1069 | - public function hash(object|array|string $data, $algo = 'md5'): string |
|
| 1069 | + public function hash(object | array | string $data, $algo = 'md5'): string |
|
| 1070 | 1070 | { |
| 1071 | 1071 | switch (\gettype($data)) { |
| 1072 | 1072 | case 'object': |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | 'metatags' => [ |
| 66 | 66 | 'robots' => 'index,follow', // SEO robots default directive |
| 67 | 67 | ], |
| 68 | - 'pages' => [ // Markdown content management |
|
| 68 | + 'pages' => [// Markdown content management |
|
| 69 | 69 | 'dir' => 'pages', // pages files directory |
| 70 | 70 | 'ext' => ['md', 'markdown', 'mdown', 'mkdn', 'mkd', 'text', 'txt'], // supported files formats, by extension |
| 71 | 71 | 'exclude' => ['vendor', 'node_modules'], // directories, paths and files name to exclude (accepts globs, strings and regexes) |
@@ -99,12 +99,12 @@ discard block |
||
| 99 | 99 | 'caption' => false, // puts the image in a <figure> element and adds a <figcaption> containing the title |
| 100 | 100 | 'placeholder' => '', // fill <img> background before loading (`color` or `lqip`) |
| 101 | 101 | 'class' => '', // puts default CSS class(es) to each image |
| 102 | - 'remote' => [ // turns remote images into Assets to process them (disable with `false`) |
|
| 102 | + 'remote' => [// turns remote images into Assets to process them (disable with `false`) |
|
| 103 | 103 | 'fallback' => '', // path to the fallback image, stored in assets directory (empty by default) |
| 104 | 104 | ], |
| 105 | 105 | ], |
| 106 | 106 | 'links' => [ |
| 107 | - 'embed' => [ // turns links in embedded content if possible |
|
| 107 | + 'embed' => [// turns links in embedded content if possible |
|
| 108 | 108 | 'enabled' => false, |
| 109 | 109 | 'video' => ['mp4', 'webm'], // supported video file types, by extension |
| 110 | 110 | 'audio' => ['mp3', 'ogg', 'wav'], // supported audio file types, by extension |
@@ -125,16 +125,16 @@ discard block |
||
| 125 | 125 | // <position> => 'Cecil\Generator\<class>', |
| 126 | 126 | //], |
| 127 | 127 | ], |
| 128 | - 'data' => [ // data files |
|
| 128 | + 'data' => [// data files |
|
| 129 | 129 | 'dir' => 'data', // data files directory |
| 130 | 130 | 'ext' => ['yaml', 'yml', 'json', 'xml', 'csv'], // loaded files by extension |
| 131 | 131 | 'load' => true, // enables `site.data` collection |
| 132 | 132 | ], |
| 133 | - 'assets' => [ // assets: CSS, JS, images, etc. |
|
| 133 | + 'assets' => [// assets: CSS, JS, images, etc. |
|
| 134 | 134 | 'dir' => 'assets', // assets files directory |
| 135 | 135 | 'target' => '', // where processed assets are saved (in output directory) |
| 136 | 136 | 'fingerprint' => true, // enables fingerprinting |
| 137 | - 'compile' => [ // Sass files compilation |
|
| 137 | + 'compile' => [// Sass files compilation |
|
| 138 | 138 | 'style' => 'expanded', // compilation style (`expanded` or `compressed`) |
| 139 | 139 | 'import' => ['sass', 'scss', 'node_modules'], // list of imported directories |
| 140 | 140 | 'sourcemap' => false, // enables sourcemap in debug mode |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | 'images' => [ |
| 152 | 152 | 'optimize' => false, // enables images optimization with JpegOptim, Optipng, Pngquant 2, SVGO 1, Gifsicle, cwebp, avifenc |
| 153 | 153 | 'quality' => 75, // image quality after optimization or resize |
| 154 | - 'responsive' => [ // options of generated responsive images |
|
| 154 | + 'responsive' => [// options of generated responsive images |
|
| 155 | 155 | 'widths' => [480, 640, 768, 1024, 1366, 1600, 1920], // `srcset` widths |
| 156 | 156 | 'sizes' => ['default' => '100vw'] // default `sizes` attribute |
| 157 | 157 | ], |
@@ -165,26 +165,26 @@ discard block |
||
| 165 | 165 | //] |
| 166 | 166 | ], |
| 167 | 167 | ], |
| 168 | - 'static' => [ // static files |
|
| 168 | + 'static' => [// static files |
|
| 169 | 169 | 'dir' => 'static', // static files directory |
| 170 | 170 | 'target' => '', // subdirectory where files are copied |
| 171 | 171 | 'exclude' => ['sass', 'scss', '*.scss', 'package*.json', 'node_modules'], // excluded files by extension or pattern |
| 172 | 172 | 'load' => false, // enables `site.static` collection |
| 173 | 173 | ], |
| 174 | - 'layouts' => [ // layouts and templates |
|
| 174 | + 'layouts' => [// layouts and templates |
|
| 175 | 175 | 'dir' => 'layouts', // Twig templates directory |
| 176 | - 'images' => [ // how to handle images in templates |
|
| 176 | + 'images' => [// how to handle images in templates |
|
| 177 | 177 | 'formats' => [], // creates and adds formats images as `source` (e.g.: ['avif', 'webp']) |
| 178 | 178 | 'responsive' => false, // enables responsive images |
| 179 | 179 | ], |
| 180 | - 'translations' => [ // i18n |
|
| 180 | + 'translations' => [// i18n |
|
| 181 | 181 | 'dir' => 'translations', // translations files directory |
| 182 | 182 | 'formats' => ['yaml', 'mo'], // translations supported formats |
| 183 | 183 | ], |
| 184 | - 'extensions' => [ // list of Twig extensions class |
|
| 184 | + 'extensions' => [// list of Twig extensions class |
|
| 185 | 185 | //'<name>' => 'Cecil\Renderer\Extension\<class>', |
| 186 | 186 | ], |
| 187 | - 'components' => [ // components |
|
| 187 | + 'components' => [// components |
|
| 188 | 188 | 'dir' => 'components', // components directory |
| 189 | 189 | 'ext' => 'twig', // components files extension |
| 190 | 190 | ], |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | // '<section>' => '<layout>', |
| 193 | 193 | //] |
| 194 | 194 | ], |
| 195 | - 'output' => [ // output formats and post process |
|
| 195 | + 'output' => [// output formats and post process |
|
| 196 | 196 | 'dir' => '_site', // output directory |
| 197 | 197 | //'formats' => [ // https://cecil.app/documentation/configuration/#formats |
| 198 | 198 | // [ |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | // 'exclude' => ['variable1', 'variable2'], |
| 204 | 204 | // ], |
| 205 | 205 | //], |
| 206 | - 'pagetypeformats' => [ // formats applied by page type |
|
| 206 | + 'pagetypeformats' => [// formats applied by page type |
|
| 207 | 207 | 'page' => ['html'], |
| 208 | 208 | 'homepage' => ['html', 'atom'], |
| 209 | 209 | 'section' => ['html', 'atom'], |
@@ -214,10 +214,10 @@ discard block |
||
| 214 | 214 | // '<name>' => 'Cecil\Renderer\PostProcessor\<class>', |
| 215 | 215 | //], |
| 216 | 216 | ], |
| 217 | - 'cache' => [ // cache management |
|
| 217 | + 'cache' => [// cache management |
|
| 218 | 218 | 'enabled' => true, // disable with `false` |
| 219 | 219 | 'dir' => '.cache', // cache files root directory |
| 220 | - 'assets' => [ // assets cache |
|
| 220 | + 'assets' => [// assets cache |
|
| 221 | 221 | 'ttl' => null, // assets cache TTL (no expiration by default) |
| 222 | 222 | 'remote' => [ |
| 223 | 223 | 'ttl' => 604800, // remote assets cache TTL (7 days by default) |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | 'templates' => true, // disable Twig templates cache with `false` |
| 227 | 227 | 'translations' => true, // disable translations dictionary cache with `false` |
| 228 | 228 | ], |
| 229 | - 'optimize' => [ // files optimization |
|
| 229 | + 'optimize' => [// files optimization |
|
| 230 | 230 | 'enabled' => false, // enables files optimization |
| 231 | 231 | 'html' => [ |
| 232 | 232 | 'enabled' => true, // enables HTML files optimization |