From 2382709bfae243629c292335dfe8bc7722169b89 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 23 Jul 2024 18:31:58 +0200 Subject: [PATCH 1/2] Update blog posts to use `BlogPosting` Schema.org type This is a more specific subset of Article. Fixes https://github.com/hydephp/develop/issues/1842 --- RELEASE_NOTES.md | 1 + .../framework/resources/views/components/post/article.blade.php | 2 +- .../framework/tests/Feature/StaticSiteBuilderPostModuleTest.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 11438f7662f..d5ce619590d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -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 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 diff --git a/packages/framework/resources/views/components/post/article.blade.php b/packages/framework/resources/views/components/post/article.blade.php index 9d54df611f2..bed0f77e4fc 100644 --- a/packages/framework/resources/views/components/post/article.blade.php +++ b/packages/framework/resources/views/components/post/article.blade.php @@ -1,4 +1,4 @@ -
Features::hasTorchlight()])> @if($page->getCanonicalUrl() !== null) diff --git a/packages/framework/tests/Feature/StaticSiteBuilderPostModuleTest.php b/packages/framework/tests/Feature/StaticSiteBuilderPostModuleTest.php index 10af1b63700..18f4743ecdb 100644 --- a/packages/framework/tests/Feature/StaticSiteBuilderPostModuleTest.php +++ b/packages/framework/tests/Feature/StaticSiteBuilderPostModuleTest.php @@ -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"', From 12001d9dea7bc2c0a6570acb49c139eb3b3e40d2 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 23 Jul 2024 18:39:21 +0200 Subject: [PATCH 2/2] Update blog post feeds to use `BlogPosting` Schema.org type This is a more specific subset of Article. See https://github.com/hydephp/develop/issues/1842 --- RELEASE_NOTES.md | 2 +- .../resources/views/components/article-excerpt.blade.php | 2 +- packages/framework/tests/Unit/Views/ArticleExcerptViewTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index d5ce619590d..b4899c03a0c 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -39,7 +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 to use the `BlogPosting` Schema.org type instead of `Article` in https://github.com/hydephp/develop/pull/1887 +- 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 diff --git a/packages/framework/resources/views/components/article-excerpt.blade.php b/packages/framework/resources/views/components/article-excerpt.blade.php index 666c628ab0f..3e4574f2343 100644 --- a/packages/framework/resources/views/components/article-excerpt.blade.php +++ b/packages/framework/resources/views/components/article-excerpt.blade.php @@ -1,5 +1,5 @@ @php /** @var \Hyde\Pages\MarkdownPost $post */ @endphp -
+
@if(Hyde::hasSiteUrl()) diff --git a/packages/framework/tests/Unit/Views/ArticleExcerptViewTest.php b/packages/framework/tests/Unit/Views/ArticleExcerptViewTest.php index 48e1818fcf0..508b009f5cd 100644 --- a/packages/framework/tests/Unit/Views/ArticleExcerptViewTest.php +++ b/packages/framework/tests/Unit/Views/ArticleExcerptViewTest.php @@ -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()