Skip to content

Commit

Permalink
Merge pull request #241 from hydephp/230-bug-category-component-shoul…
Browse files Browse the repository at this point in the history
…d-not-be-included-if-category-is-not-set-in-front-matter

Fix bugs in article and excerpts not fluently constructing descriptions
  • Loading branch information
caendesilva authored May 2, 2022
2 parents 17943a7 + 2c66a7d commit 4c79af0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion resources/views/components/article-excerpt.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@isset($post->matter['date'])
<span class="opacity-75">
<span itemprop="dateCreated datePublished">
{{ date('M jS, Y', strtotime($post->matter['date'])) }}</span>,
{{ date('M jS, Y', strtotime($post->matter['date'])) }}</span>{{ isset($post->matter['author']) ? ',' : '' }}
</span>
@endisset
@isset($post->matter['author'])
Expand Down
4 changes: 2 additions & 2 deletions src/Models/MarkdownPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MarkdownPost extends MarkdownDocument
use HasDateString;
use HasFeaturedImage;

public string $category;
public ?string $category;

public static string $sourceDirectory = '_posts';
public static string $parserClass = MarkdownPostParser::class;
Expand All @@ -29,6 +29,6 @@ public function __construct(array $matter, string $body, string $title = '', str
$this->constructDateString();
$this->constructFeaturedImage();

$this->category = $this->matter['category'] ?? '';
$this->category = $this->matter['category'] ?? null;
}
}

0 comments on commit 4c79af0

Please sign in to comment.