Skip to content

Commit

Permalink
Merge pull request #1887 from hydephp/use-blog-posting-schema-type-fo…
Browse files Browse the repository at this point in the history
…r-blog-posts

[2.x] Update blog posts to use `BlogPosting` Schema.org type
  • Loading branch information
caendesilva authored Jul 23, 2024
2 parents e03376a + 12001d9 commit 0e6468f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ This serves two purposes:
- Minor: `Includes::path()` and `Includes::get()` methods now normalizes paths to be basenames to match the behaviour of the other include methods in https://github.com/hydephp/develop/pull/1738. This means that nested directories are no longer supported, as you should use a data collection for that.
- Minor: The `processing_time_ms` attribute in the `sitemap.xml` file has now been removed in https://github.com/hydephp/develop/pull/1744
- Minor: Updated the `Hyde::url()` helper to return `null` instead of throwing a `BaseUrlNotSetException` when no site URL is set and no path was provided to the method in https://github.com/hydephp/develop/pull/1760
- Minor: Updated the blog post layout and post feed component to use the `BlogPosting` Schema.org type instead of `Article` in https://github.com/hydephp/develop/pull/1887
- Overhauled the blog post author feature in https://github.com/hydephp/develop/pull/1782
- Improved the sitemap data generation to be smarter and more dynamic in https://github.com/hydephp/develop/pull/1744
- Skipped build tasks will now exit with an exit code of 3 instead of 0 in https://github.com/hydephp/develop/pull/1749
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@php /** @var \Hyde\Pages\MarkdownPost $post */ @endphp
<article class="mt-4 mb-8" itemscope itemtype="https://schema.org/Article">
<article class="mt-4 mb-8" itemscope itemtype="https://schema.org/BlogPosting">
<meta itemprop="identifier" content="{{ $post->identifier }}">
@if(Hyde::hasSiteUrl())
<meta itemprop="url" content="{{ Hyde::url('posts/' . $post->identifier) }}">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<article aria-label="Article" id="{{ $page->identifier }}" itemscope itemtype="https://schema.org/Article"
<article aria-label="Article" id="{{ $page->identifier }}" itemscope itemtype="https://schema.org/BlogPosting"
@class(['post-article mx-auto', config('markdown.prose_classes', 'prose dark:prose-invert'), 'torchlight-enabled' => Features::hasTorchlight()])>
<meta itemprop="identifier" content="{{ $page->identifier }}">
@if($page->getCanonicalUrl() !== null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function testPostContainsExpectedMetaTags()
public function testPostContainsExpectedItemprops()
{
$this->inspectHtml([
'itemtype="https://schema.org/Article"',
'itemtype="https://schema.org/BlogPosting"',
'itemtype="https://schema.org/Person"',
'itemprop="identifier"',
'itemprop="headline"',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function renderTestView(MarkdownPost $post): string
public function testComponentCanBeRendered()
{
$view = $this->renderTestView(MarkdownPost::make());
$this->assertStringContainsString('https://schema.org/Article', $view);
$this->assertStringContainsString('https://schema.org/BlogPosting', $view);
}

public function testComponentRendersPostData()
Expand Down

0 comments on commit 0e6468f

Please sign in to comment.