Skip to content

Commit

Permalink
update build output
Browse files Browse the repository at this point in the history
  • Loading branch information
bangnokia committed May 12, 2024
1 parent 4caf2fd commit ce8a696
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 176 deletions.
2 changes: 1 addition & 1 deletion app/Commands/BuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function handle(): int

protected function buildItem(Content $item, MarkdownRenderer $renderer): void
{
$directory = getcwd() . '/public/' . ($item->url() === '/' ? 'index.html' : ($item->url() . '/index.html'));
$directory = getcwd() . '/public/' . ($item->url() === '/' ? 'index.html' : ($item->url() . '.html'));

if (!is_dir(dirname($directory))) {
mkdir(dirname($directory), 0755, true);
Expand Down
Empty file removed skeleton/public/images/.gitkeep
Empty file.
155 changes: 0 additions & 155 deletions skeleton/public/style.css

This file was deleted.

39 changes: 19 additions & 20 deletions tests/Feature/BuildCommandTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

it('can build index page with component', function () {
$skeletonPath = __DIR__.'/../skeleton';
$skeletonPath = __DIR__.'/../../skeleton';
chdir($skeletonPath);
exec('rm -rf public/*');

Expand All @@ -10,25 +10,24 @@
// ->expectsOutput('building posts/2020-11-01-foo.md...')
->assertExitCode(0);

$this->assertFileExists($skeletonPath.'/public/posts/hello-world.html');
$this->assertFileExists($skeletonPath.'/public/posts/foo.html');
$this->assertFileDoesNotExist($skeletonPath.'/public/posts/bar.html');
$this->assertFileExists($skeletonPath.'/public/posts/hello.html'); // post hello
$this->assertFileDoesNotExist($skeletonPath.'/public/posts/bar.html'); // post foo, not exist

$this->assertFileExists($skeletonPath.'/public/page-foo.html'); // page foo
$this->assertFileExists($skeletonPath.'/public/about.html'); // page about
$this->assertFileExists($skeletonPath.'/public/index.html'); // index page

$this->assertEquals(
file_get_contents(base_path('tests/expected/hello-world.html')),
file_get_contents($skeletonPath.'/public/posts/hello-world.html')
);

$this->assertEquals(
file_get_contents(base_path('tests/expected/page-foo.html')),
file_get_contents($skeletonPath.'/public/page-foo.html')
);

$this->assertEquals(
file_get_contents(base_path('tests/expected/index.html')),
file_get_contents($skeletonPath.'/public/index.html')
);
})->skip();
// $this->assertEquals(
// file_get_contents(base_path('tests/expected/hello-world.html')),
// file_get_contents($skeletonPath.'/public/posts/hello-world.html')
// );
//
// $this->assertEquals(
// file_get_contents(base_path('tests/expected/page-foo.html')),
// file_get_contents($skeletonPath.'/public/page-foo.html')
// );
//
// $this->assertEquals(
// file_get_contents(base_path('tests/expected/index.html')),
// file_get_contents($skeletonPath.'/public/index.html')
// );
});

0 comments on commit ce8a696

Please sign in to comment.