Skip to content

Commit

Permalink
corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
Arbeit authored and Arbeit committed Feb 24, 2018
1 parent 4a707c4 commit f83fd66
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Leaf.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ function __construct($uri)
if ( $this->uri )
{
$uri_parts = explode('/', $uri);
$uri_base = $uri_parts[0] . '/index.md';

$this->constructBase();
$this->menu = $this->constructMenu($uri_parts[0]);
}
Expand Down Expand Up @@ -57,8 +55,16 @@ public function exists($uri)
public function constructBase()
{
$uri_parts = explode('/', $this->uri);
$base = $uri_parts[0];
if ( File::exists($base) )

$base = $uri_parts[0] . '/index.md';
if ( Storage::disk('leaves')->exists($base) )
{
$this->base = $this->retriveMetas($base, 'leaves');
$this->base['slug'] = $base;
}

$base = $uri_parts[0] . '/index.html';
if ( Storage::disk('leaves')->exists($base) )
{
$this->base = $this->retriveMetas($base, 'leaves');
$this->base['slug'] = $base;
Expand Down

0 comments on commit f83fd66

Please sign in to comment.