Skip to content

adding verbose option #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions config/ssg.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,18 @@

'failures' => false, // 'errors' or 'warnings'

/*
|--------------------------------------------------------------------------
| Verbosity
|--------------------------------------------------------------------------
|
| By default SSG will print out a lot of information about
| what it is doing, including a line for every file it outputs.
|
| This option allows you to choose to get a little less information.
|
*/

'verbose' => true,

];
5 changes: 4 additions & 1 deletion src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ protected function makeContentGenerationClosures($pages, $request)
$count = 0;
$warnings = [];
$errors = [];
$verbose = config('statamic.ssg.verbose');

foreach ($pages as $page) {
// There is no getter method, so use reflection.
Expand All @@ -279,7 +280,9 @@ protected function makeContentGenerationClosures($pages, $request)

$request->setPage($page);

Partyline::line("\x1B[1A\x1B[2KGenerating ".$page->url());
if ($verbose) {
Partyline::line("\x1B[1A\x1B[2KGenerating " . $page->url());
};

try {
$generated = $page->generate($request);
Expand Down