forked from CouscousPHP/Couscous
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request CouscousPHP#113 from MontealegreLuis/master
Add images outside the template folder to the current project.
- Loading branch information
Showing
14 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Couscous\Module\Core\Step; | ||
|
||
use Couscous\Model\LazyFile; | ||
use Couscous\Model\Project; | ||
use Couscous\Step; | ||
|
||
/** | ||
* Add images to the project | ||
* | ||
* @author Matthieu Napoli <matthieu@mnapoli.fr> | ||
*/ | ||
class AddImages implements Step | ||
{ | ||
/** | ||
* Add images to the given project. | ||
* | ||
* @param Project $project | ||
*/ | ||
public function __invoke(Project $project) | ||
{ | ||
$files = $project->sourceFiles(); | ||
$files | ||
->name('*.gif') | ||
->name('*.png') | ||
->name('*.jpg') | ||
; | ||
|
||
$project->watchlist->watchFiles($files); | ||
|
||
foreach ($files as $file) { | ||
/** @var SplFileInfo $file */ | ||
$project->addFile(new LazyFile($file->getPathname(), $file->getRelativePathname())); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Documentation</title> | ||
</head> | ||
<body> | ||
<p>Hello, this is a test!</p> | ||
<p><img src="/logos/couscous.jpg" alt="Couscous logo" title="Couscous logo (.jpg)" /></p> | ||
<p><img src="/logos/couscous.png" alt="Couscous logo" title="Couscous logo (.png)" /></p> | ||
<p><img src="/logos/couscous.gif" alt="Couscous logo" title="Couscous logo (.gif)" /></p> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Hello, this is a test! | ||
|
||
|
||
![Couscous logo](/logos/couscous.jpg "Couscous logo (.jpg)") | ||
|
||
![Couscous logo](/logos/couscous.png "Couscous logo (.png)") | ||
|
||
![Couscous logo](/logos/couscous.gif "Couscous logo (.gif)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
exclude: | ||
- exclude |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions
9
tests/FunctionalTest/Fixture/images/source/website/default.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Documentation</title> | ||
</head> | ||
<body> | ||
{{ content|raw }} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters