@@ -53,8 +53,8 @@ |
||
53 | 53 | |
54 | 54 | // handles options |
55 | 55 | $canonical = null; // if true prefix url with baseurl config |
56 | - $format = null; // output format |
|
57 | - $language = null; // force language |
|
56 | + $format = null; // output format |
|
57 | + $language = null; // force language |
|
58 | 58 | extract(\is_array($options) ? $options : [], EXTR_IF_EXISTS); |
59 | 59 | |
60 | 60 | // canonical URL? |
@@ -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,7 +99,7 @@ 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 | ], |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | //], |
112 | 112 | 'external' => [ |
113 | 113 | 'blank' => false, // if `true` open external link in new tab |
114 | - 'noopener' => true, // add "noopener" to `rel` attribute |
|
115 | - 'noreferrer' => true, // add "noreferrer" to `rel` attribute |
|
116 | - 'nofollow' => true, // add "nofollow" to `rel` attribute |
|
114 | + 'noopener' => true, // add "noopener" to `rel` attribute |
|
115 | + 'noreferrer' => true, // add "noreferrer" to `rel` attribute |
|
116 | + 'nofollow' => true, // add "nofollow" to `rel` attribute |
|
117 | 117 | ] |
118 | 118 | ], |
119 | 119 | 'excerpt' => [ |
@@ -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' => 'assets', // where processed assets are saved (in output directory) |
136 | 136 | 'fingerprint' => true, // enables fingerprinting |
137 | - 'compile' => [ // disable Sass files compilation with `false` |
|
137 | + 'compile' => [// disable Sass files compilation with `false` |
|
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 |
@@ -160,22 +160,22 @@ discard block |
||
160 | 160 | //] |
161 | 161 | ], |
162 | 162 | ], |
163 | - 'static' => [ // static files |
|
163 | + 'static' => [// static files |
|
164 | 164 | 'dir' => 'static', // static files directory |
165 | 165 | 'target' => '', // subdirectory where files are copied |
166 | 166 | 'exclude' => ['sass', 'scss', '*.scss', 'package*.json', 'node_modules'], // excluded files by extension or pattern |
167 | 167 | 'load' => false, // enables `site.static` collection |
168 | 168 | ], |
169 | - 'layouts' => [ // layouts and templates |
|
169 | + 'layouts' => [// layouts and templates |
|
170 | 170 | 'dir' => 'layouts', // Twig templates directory |
171 | - 'translations' => [ // i18n |
|
171 | + 'translations' => [// i18n |
|
172 | 172 | 'dir' => 'translations', // translations files directory |
173 | 173 | 'formats' => ['yaml', 'mo'], // translations supported formats |
174 | 174 | ], |
175 | - 'extensions' => [ // list of Twig extensions class |
|
175 | + 'extensions' => [// list of Twig extensions class |
|
176 | 176 | //'<name>' => 'Cecil\Renderer\Extension\<class>', |
177 | 177 | ], |
178 | - 'components' => [ // components |
|
178 | + 'components' => [// components |
|
179 | 179 | 'dir' => 'components', // components directory |
180 | 180 | 'ext' => 'twig', // components files extension |
181 | 181 | ], |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | // '<section>' => '<layout>', |
184 | 184 | //] |
185 | 185 | ], |
186 | - 'output' => [ // output formats and post process |
|
186 | + 'output' => [// output formats and post process |
|
187 | 187 | 'dir' => '_site', // output directory |
188 | 188 | //'formats' => [ // https://cecil.app/documentation/configuration/#formats |
189 | 189 | // [ |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | // 'exclude' => ['variable1', 'variable2'], |
195 | 195 | // ], |
196 | 196 | //], |
197 | - 'pagetypeformats' => [ // formats applied by page type |
|
197 | + 'pagetypeformats' => [// formats applied by page type |
|
198 | 198 | 'page' => ['html'], |
199 | 199 | 'homepage' => ['html', 'atom'], |
200 | 200 | 'section' => ['html', 'atom'], |
@@ -205,12 +205,12 @@ discard block |
||
205 | 205 | // '<name>' => 'Cecil\Renderer\PostProcessor\<class>', |
206 | 206 | //], |
207 | 207 | ], |
208 | - 'cache' => [ // cache management, disable with `false` |
|
208 | + 'cache' => [// cache management, disable with `false` |
|
209 | 209 | 'dir' => '.cache', // cache files directory |
210 | 210 | 'templates' => true, // disable Twig templates cache with `false` |
211 | 211 | 'translations' => true, // disable translations dictionary cache with `false` |
212 | 212 | ], |
213 | - 'optimize' => [ // files optimization |
|
213 | + 'optimize' => [// files optimization |
|
214 | 214 | 'enabled' => false, // enables files optimization |
215 | 215 | 'html' => [ |
216 | 216 | 'enabled' => true, // enables HTML files optimization |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $this->options = array_merge([ |
149 | 149 | 'drafts' => false, // build drafts or not |
150 | 150 | 'dry-run' => false, // if dry-run is true, generated files are not saved |
151 | - 'page' => '', // specific page to build |
|
151 | + 'page' => '', // specific page to build |
|
152 | 152 | ], $options); |
153 | 153 | |
154 | 154 | // process each step |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | /** |
195 | 195 | * Set configuration. |
196 | 196 | */ |
197 | - public function setConfig(array|Config $config): self |
|
197 | + public function setConfig(array | Config $config): self |
|
198 | 198 | { |
199 | 199 | if (\is_array($config)) { |
200 | 200 | $config = new Config($config); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | { |
68 | 68 | $this->data->import($config, $mode); |
69 | 69 | $this->setFromEnv(); // override configuration with environment variables |
70 | - $this->validate(); // validate configuration |
|
70 | + $this->validate(); // validate configuration |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | * |
386 | 386 | * @throws ConfigException |
387 | 387 | */ |
388 | - public function getOutputFormatProperty(string $name, string $property): string|array|null |
|
388 | + public function getOutputFormatProperty(string $name, string $property): string | array | null |
|
389 | 389 | { |
390 | 390 | $properties = array_column((array) $this->get('output.formats'), $property, 'name'); |
391 | 391 | if (empty($properties)) { |