@@ -333,7 +333,7 @@ |
||
| 333 | 333 | * |
| 334 | 334 | * @throws ConfigException |
| 335 | 335 | */ |
| 336 | - public function getOutputFormatProperty(string $name, string $property): string|array|null |
|
| 336 | + public function getOutputFormatProperty(string $name, string $property): string | array | null |
|
| 337 | 337 | { |
| 338 | 338 | $properties = array_column((array) $this->get('output.formats'), $property, 'name'); |
| 339 | 339 | |
@@ -83,81 +83,81 @@ |
||
| 83 | 83 | ], |
| 84 | 84 | 'output' => [ |
| 85 | 85 | 'formats' => [ |
| 86 | - [ // e.g.: blog/post-1/index.html |
|
| 86 | + [// e.g.: blog/post-1/index.html |
|
| 87 | 87 | 'name' => 'html', |
| 88 | 88 | 'mediatype' => 'text/html', |
| 89 | 89 | 'filename' => 'index', |
| 90 | 90 | 'extension' => 'html', |
| 91 | 91 | ], |
| 92 | - [ // e.g.: blog/atom.xml |
|
| 92 | + [// e.g.: blog/atom.xml |
|
| 93 | 93 | 'name' => 'atom', |
| 94 | 94 | 'mediatype' => 'application/atom+xml', |
| 95 | 95 | 'filename' => 'atom', |
| 96 | 96 | 'extension' => 'xml', |
| 97 | 97 | 'exclude' => ['redirect', 'paginated'], |
| 98 | 98 | ], |
| 99 | - [ // e.g.: blog/rss.xml |
|
| 99 | + [// e.g.: blog/rss.xml |
|
| 100 | 100 | 'name' => 'rss', |
| 101 | 101 | 'mediatype' => 'application/rss+xml', |
| 102 | 102 | 'filename' => 'rss', |
| 103 | 103 | 'extension' => 'xml', |
| 104 | 104 | 'exclude' => ['redirect', 'paginated'], |
| 105 | 105 | ], |
| 106 | - [ // e.g.: blog.json |
|
| 106 | + [// e.g.: blog.json |
|
| 107 | 107 | 'name' => 'json', |
| 108 | 108 | 'mediatype' => 'application/json', |
| 109 | 109 | 'extension' => 'json', |
| 110 | 110 | 'exclude' => ['redirect'], |
| 111 | 111 | ], |
| 112 | - [ // e.g.: blog.xml |
|
| 112 | + [// e.g.: blog.xml |
|
| 113 | 113 | 'name' => 'xml', |
| 114 | 114 | 'mediatype' => 'application/xml', |
| 115 | 115 | 'extension' => 'xml', |
| 116 | 116 | 'exclude' => ['redirect'], |
| 117 | 117 | ], |
| 118 | - [ // e.g.: robots.txt |
|
| 118 | + [// e.g.: robots.txt |
|
| 119 | 119 | 'name' => 'txt', |
| 120 | 120 | 'mediatype' => 'text/plain', |
| 121 | 121 | 'extension' => 'txt', |
| 122 | 122 | 'exclude' => ['redirect'], |
| 123 | 123 | ], |
| 124 | - [ // e.g.: blog/post-1/amp/index.html |
|
| 124 | + [// e.g.: blog/post-1/amp/index.html |
|
| 125 | 125 | 'name' => 'amp', |
| 126 | 126 | 'mediatype' => 'text/html', |
| 127 | 127 | 'subpath' => 'amp', |
| 128 | 128 | 'filename' => 'index', |
| 129 | 129 | 'extension' => 'html', |
| 130 | 130 | ], |
| 131 | - [ // e.g.: sw.js |
|
| 131 | + [// e.g.: sw.js |
|
| 132 | 132 | 'name' => 'js', |
| 133 | 133 | 'mediatype' => 'application/javascript', |
| 134 | 134 | 'extension' => 'js', |
| 135 | 135 | ], |
| 136 | - [ // e.g.: manifest.webmanifest |
|
| 136 | + [// e.g.: manifest.webmanifest |
|
| 137 | 137 | 'name' => 'webmanifest', |
| 138 | 138 | 'mediatype' => 'application/manifest+json', |
| 139 | 139 | 'extension' => 'webmanifest', |
| 140 | 140 | ], |
| 141 | - [ // e.g.: atom.xsl |
|
| 141 | + [// e.g.: atom.xsl |
|
| 142 | 142 | 'name' => 'xsl', |
| 143 | 143 | 'mediatype' => 'application/xml', |
| 144 | 144 | 'extension' => 'xsl', |
| 145 | 145 | ], |
| 146 | - [ // e.g.: blog/feed.json |
|
| 146 | + [// e.g.: blog/feed.json |
|
| 147 | 147 | 'name' => 'jsonfeed', |
| 148 | 148 | 'mediatype' => 'application/json', |
| 149 | 149 | 'filename' => 'feed', |
| 150 | 150 | 'extension' => 'json', |
| 151 | 151 | 'exclude' => ['redirect', 'paginated'], |
| 152 | 152 | ], |
| 153 | - [ // e.g.: video/embed.html |
|
| 153 | + [// e.g.: video/embed.html |
|
| 154 | 154 | 'name' => 'iframe', |
| 155 | 155 | 'mediatype' => 'text/html', |
| 156 | 156 | 'filename' => 'embed', |
| 157 | 157 | 'extension' => 'html', |
| 158 | 158 | 'exclude' => ['redirect', 'paginated'], |
| 159 | 159 | ], |
| 160 | - [ // e.g.: video/embed.json |
|
| 160 | + [// e.g.: video/embed.json |
|
| 161 | 161 | 'name' => 'oembed', |
| 162 | 162 | 'mediatype' => 'application/json+oembed', |
| 163 | 163 | 'filename' => 'embed', |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * desc_title: false|true |
| 56 | 56 | * reverse: false|true |
| 57 | 57 | */ |
| 58 | - public function sortBy(array|string|null $options): self |
|
| 58 | + public function sortBy(array | string | null $options): self |
|
| 59 | 59 | { |
| 60 | 60 | $sortBy = \is_string($options) ? $options : $options['variable'] ?? 'date'; |
| 61 | 61 | $sortMethod = \sprintf('sortBy%s', ucfirst(str_replace('updated', 'date', $sortBy))); |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | /** |
| 70 | 70 | * Sorts pages by date (or 'updated'): the most recent first. |
| 71 | 71 | */ |
| 72 | - public function sortByDate(array|string|null $options = null): self |
|
| 72 | + public function sortByDate(array | string | null $options = null): self |
|
| 73 | 73 | { |
| 74 | 74 | $opt = []; |
| 75 | 75 | // backward compatibility (i.e. $options = 'updated') |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | /** |
| 104 | 104 | * Sorts pages by title (natural sort). |
| 105 | 105 | */ |
| 106 | - public function sortByTitle(array|string|null $options = null): self |
|
| 106 | + public function sortByTitle(array | string | null $options = null): self |
|
| 107 | 107 | { |
| 108 | 108 | $opt = []; |
| 109 | 109 | // options |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | /** |
| 118 | 118 | * Sorts by weight (the heaviest first). |
| 119 | 119 | */ |
| 120 | - public function sortByWeight(array|string|null $options = null): self |
|
| 120 | + public function sortByWeight(array | string | null $options = null): self |
|
| 121 | 121 | { |
| 122 | 122 | $opt = []; |
| 123 | 123 | // options |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | /** |
| 284 | 284 | * Convert the various expressions of a TTL value into duration in seconds. |
| 285 | 285 | */ |
| 286 | - protected function duration(\DateInterval|int|null $ttl): int |
|
| 286 | + protected function duration(\DateInterval | int | null $ttl): int |
|
| 287 | 287 | { |
| 288 | 288 | if ($ttl === null) { |
| 289 | 289 | return $this->duration; |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | return $ttl; |
| 293 | 293 | } |
| 294 | 294 | if ($ttl instanceof \DateInterval) { |
| 295 | - return (int)$ttl->format('%s'); |
|
| 295 | + return (int) $ttl->format('%s'); |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | throw new \InvalidArgumentException('TTL values must be one of null, int, \DateInterval'); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | 'max' => 5, // number of pages by each paginated pages |
| 55 | 55 | 'path' => 'page', // path to paginated pages (e.g.: `/blog/page/2/`) |
| 56 | 56 | ], |
| 57 | - 'pages' => [ // Markdown content management |
|
| 57 | + 'pages' => [// Markdown content management |
|
| 58 | 58 | 'dir' => 'pages', // pages files directory |
| 59 | 59 | 'ext' => ['md', 'markdown', 'mdown', 'mkdn', 'mkd', 'text', 'txt'], // supported files formats, by extension |
| 60 | 60 | 'exclude' => ['vendor', 'node_modules'], // directories, paths and files name to exclude (accepts globs, strings and regexes) |
@@ -112,9 +112,9 @@ discard block |
||
| 112 | 112 | ], |
| 113 | 113 | 'external' => [ |
| 114 | 114 | 'blank' => false, // if true open external link in new tab |
| 115 | - 'noopener' => true, // add "noopener" to `rel` attribute |
|
| 116 | - 'noreferrer' => true, // add "noreferrer" to `rel` attribute |
|
| 117 | - 'nofollow' => true, // add "nofollow" to `rel` attribute |
|
| 115 | + 'noopener' => true, // add "noopener" to `rel` attribute |
|
| 116 | + 'noreferrer' => true, // add "noreferrer" to `rel` attribute |
|
| 117 | + 'nofollow' => true, // add "nofollow" to `rel` attribute |
|
| 118 | 118 | ] |
| 119 | 119 | ], |
| 120 | 120 | 'excerpt' => [ |
@@ -126,18 +126,18 @@ discard block |
||
| 126 | 126 | // <position> => 'Cecil\Generator\<class>', |
| 127 | 127 | //], |
| 128 | 128 | ], |
| 129 | - 'data' => [ // data files |
|
| 129 | + 'data' => [// data files |
|
| 130 | 130 | 'dir' => 'data', // data files directory |
| 131 | 131 | 'ext' => ['yaml', 'yml', 'json', 'xml', 'csv'], // loaded files by extension |
| 132 | 132 | 'load' => true, // enables `site.data` collection |
| 133 | 133 | ], |
| 134 | - 'static' => [ // static files |
|
| 134 | + 'static' => [// static files |
|
| 135 | 135 | 'dir' => 'static', // static files directory |
| 136 | 136 | 'target' => '', // subdirectory where files are copied |
| 137 | 137 | 'exclude' => ['sass', 'scss', '*.scss', 'package*.json', 'node_modules'], // excluded files by extension or pattern |
| 138 | 138 | 'load' => false, // enables `site.static` collection |
| 139 | 139 | ], |
| 140 | - 'assets' => [ // assets: CSS, JS, images, etc. |
|
| 140 | + 'assets' => [// assets: CSS, JS, images, etc. |
|
| 141 | 141 | 'dir' => 'assets', // assets files directory |
| 142 | 142 | 'target' => 'assets', // where remote and resized assets are saved |
| 143 | 143 | 'fingerprint' => [ |
@@ -168,9 +168,9 @@ discard block |
||
| 168 | 168 | ], |
| 169 | 169 | 'formats' => [], // `html` filter: creates and adds formats images as `source` (ie "webp" and/or "avif") |
| 170 | 170 | 'cdn' => [ |
| 171 | - 'enabled' => false, // enables Image CDN |
|
| 172 | - 'canonical' => true, // is `image_url` must be canonical or not |
|
| 173 | - 'remote' => true, // includes remote images |
|
| 171 | + 'enabled' => false, // enables Image CDN |
|
| 172 | + 'canonical' => true, // is `image_url` must be canonical or not |
|
| 173 | + 'remote' => true, // includes remote images |
|
| 174 | 174 | //'account' => 'xxxx', // provider account |
| 175 | 175 | // Cloudinary |
| 176 | 176 | //'url' => 'https://res.cloudinary.com/%account%/image/fetch/c_limit,w_%width%,q_%quality%,f_%format%,d_default/%image_url%', |
@@ -183,22 +183,22 @@ discard block |
||
| 183 | 183 | ] |
| 184 | 184 | ], |
| 185 | 185 | ], |
| 186 | - 'layouts' => [ // layouts and templates |
|
| 186 | + 'layouts' => [// layouts and templates |
|
| 187 | 187 | 'dir' => 'layouts', // Twig templates directory |
| 188 | 188 | 'internal' => [ |
| 189 | 189 | 'dir' => 'resources/layouts', // internal templates directory |
| 190 | 190 | ], |
| 191 | - 'translations' => [ // i18n |
|
| 191 | + 'translations' => [// i18n |
|
| 192 | 192 | 'dir' => 'translations', // translations files directory |
| 193 | 193 | 'formats' => ['yaml', 'mo'], // translations supported formats |
| 194 | 194 | 'internal' => [ |
| 195 | 195 | 'dir' => 'resources/translations', // internal translations directory |
| 196 | 196 | ], |
| 197 | 197 | ], |
| 198 | - 'extensions' => [ // list of Twig extensions class |
|
| 198 | + 'extensions' => [// list of Twig extensions class |
|
| 199 | 199 | //'<name>' => 'Cecil\Renderer\Extension\<class>', |
| 200 | 200 | ], |
| 201 | - 'components' => [ // components |
|
| 201 | + 'components' => [// components |
|
| 202 | 202 | 'dir' => 'components', // components directory |
| 203 | 203 | 'ext' => 'twig', // components files extension |
| 204 | 204 | ], |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | 'metatags' => [ |
| 210 | 210 | 'robots' => 'index,follow', // SEO robots default directive |
| 211 | 211 | ], |
| 212 | - 'output' => [ // output formats and post process |
|
| 212 | + 'output' => [// output formats and post process |
|
| 213 | 213 | 'dir' => '_site', // output directory |
| 214 | 214 | //'formats' => [ // https://cecil.app/documentation/configuration/#formats |
| 215 | 215 | // [ |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | // 'exclude' => ['variable1', 'variable2'], |
| 221 | 221 | // ], |
| 222 | 222 | //], |
| 223 | - 'pagetypeformats' => [ // formats applied by page type |
|
| 223 | + 'pagetypeformats' => [// formats applied by page type |
|
| 224 | 224 | 'page' => ['html'], |
| 225 | 225 | 'homepage' => ['html', 'atom'], |
| 226 | 226 | 'section' => ['html', 'atom'], |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | // '<name>' => 'Cecil\Renderer\PostProcessor\<class>', |
| 232 | 232 | //], |
| 233 | 233 | ], |
| 234 | - 'cache' => [ // cache management |
|
| 234 | + 'cache' => [// cache management |
|
| 235 | 235 | 'enabled' => true, // enables cache support |
| 236 | 236 | 'dir' => '.cache', // cache files directory |
| 237 | 237 | 'templates' => [ |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | 'dir' => 'translations', // translations files cache directory |
| 250 | 250 | ], |
| 251 | 251 | ], |
| 252 | - 'optimize' => [ // files optimization |
|
| 252 | + 'optimize' => [// files optimization |
|
| 253 | 253 | 'enabled' => false, // enables files optimization |
| 254 | 254 | 'html' => [ |
| 255 | 255 | 'enabled' => true, // enables HTML files optimization |