diff --git a/docs/4-Configuration.md b/docs/4-Configuration.md index fdf678f6..1d498947 100644 --- a/docs/4-Configuration.md +++ b/docs/4-Configuration.md @@ -833,6 +833,7 @@ static: target: '' # target directory exclude: ['sass', 'scss', '*.scss', 'package*.json', 'node_modules'] # list of excluded files (accepts globs, strings and regexes) load: false # enables `site.static` collection (`false` by default) + mounts: [] # allows to copy specific files or directories to specific destination in files directory ``` :::important @@ -848,6 +849,16 @@ exclude: ['sass', 'scss', '*.scss', 'package*.json', '#node_modules/(?!bootstrap ::: +:::tip +You can copy some files to a specific destination. + +```yaml +mounts: + 'static/node_modules/bootstrap-icons/font/fonts': 'fonts' +``` + +::: + _Example:_ ```yaml diff --git a/src/Step/StaticFiles/Copy.php b/src/Step/StaticFiles/Copy.php index 9242e2a0..874d81a0 100644 --- a/src/Step/StaticFiles/Copy.php +++ b/src/Step/StaticFiles/Copy.php @@ -69,6 +69,13 @@ public function process(): void } } + // copying mounts + if ($this->config->get('static.mounts')) { + foreach ($this->config->get('static.mounts') as $source => $destination) { + $this->copy(Util::joinFile($this->config->getStaticPath(), (string) $source), (string) $destination); + } + } + // copying content of 'static/' dir if exists $this->copy($this->config->getStaticPath(), $target, $exclude); diff --git a/tests/fixtures/website/config.php b/tests/fixtures/website/config.php index 4a7d563a..99e68c98 100644 --- a/tests/fixtures/website/config.php +++ b/tests/fixtures/website/config.php @@ -176,6 +176,9 @@ 'path', ], 'load' => true, + 'mounts' => [ + 'video' => 'mount_test', + ], ], 'assets' => [ 'compile' => [