Skip to content

Commit

Permalink
Use PNG for SDC's thumbnail (#192)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthieu SCARSET <m@matthieuscarset.com>
Co-authored-by: chesn0k <spam.yureskul@gmail.com>
  • Loading branch information
3 people authored Oct 30, 2024
1 parent 6fa6677 commit d0a6ed7
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Command/SingleDirectoryComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ private function generateAssets(array $vars, AssetCollection $assets): void {
$assets->addFile($component_path . '{component_machine_name}.component.yml', 'component.twig');
$assets->addFile($component_path . 'README.md', 'readme.twig');

$contents = \file_get_contents($this->getTemplatePath() . \DIRECTORY_SEPARATOR . 'thumbnail.jpg');
$thumbnail = new File($component_path . 'thumbnail.jpg');
$contents = \file_get_contents($this->getTemplatePath() . \DIRECTORY_SEPARATOR . 'thumbnail.png');
$thumbnail = new File($component_path . 'thumbnail.png');
$thumbnail->content($contents);
$assets[] = $thumbnail;
}
Expand Down
Binary file removed templates/_sdc/thumbnail.jpg
Binary file not shown.
Binary file added templates/_sdc/thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions tests/functional/Generator/SingleDirectoryComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function testGenerator(): void {
• components/bar/bar.js
• components/bar/bar.twig
• components/bar/README.md
• components/bar/thumbnail.jpg
• components/bar/thumbnail.png

TXT;
$this->assertDisplay($expected_display);
Expand All @@ -111,7 +111,7 @@ public function testGenerator(): void {
$this->assertGeneratedFile('components/bar/bar.js');
$this->assertGeneratedFile('components/bar/bar.twig');
$this->assertGeneratedFile('components/bar/README.md');
$this->assertGeneratedFile('components/bar/thumbnail.jpg');
$this->assertGeneratedFile('components/bar/thumbnail.png');
}

}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d0a6ed7

Please sign in to comment.