Skip to content

Commit aadbf6c

Browse files
authored
Merge pull request #1257 from hydephp/fix-bug-where-post-view-is-not-using-proper-route-keys
Bugfixes: Blog post view uses legacy non-dynamic path information for metadata
2 parents 7b9b029 + c3e34e0 commit aadbf6c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This serves two purposes:
2424
- Removed `RenderData:.getCurrentRoute` method deprecated in v1.0.0-RC.2
2525

2626
### Fixed
27-
- for any bug fixes.
27+
- Fixed the blog post article view where metadata assembly used legacy hard-coded paths instead of dynamic path information.
2828

2929
### Security
3030
- in case of vulnerabilities.

packages/framework/resources/views/components/post/article.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<article aria-label="Article" id="{{ Hyde::url("posts/$page->identifier", '') }}" itemscope
1+
<article aria-label="Article" id="{{ $page->identifier }}" itemscope
22
itemtype="https://schema.org/Article"
33
@class(['post-article mx-auto prose dark:prose-invert', 'torchlight-enabled' => Hyde\Facades\Features::hasTorchlight()])>
44
<meta itemprop="identifier" content="{{ $page->identifier }}">
5-
@if(Hyde::hasSiteUrl())
6-
<meta itemprop="url" content="{{ Hyde::url('posts/' . $page->identifier) }}">
5+
@isset($page->canonicalUrl)
6+
<meta itemprop="url" content="{{ $page->canonicalUrl }}">
77
@endif
88

99
<header aria-label="Header section" role="doc-pageheader">

packages/framework/tests/Feature/MetadataViewTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function test_metadata_tags_in_empty_markdown_post()
149149
'<meta property="og:url" content="http://localhost/posts/test.html">',
150150
'<meta property="og:type" content="article">',
151151
'<meta itemprop="identifier" content="test">',
152-
'<meta itemprop="url" content="http://localhost/posts/test">',
152+
'<meta itemprop="url" content="http://localhost/posts/test.html">',
153153
]));
154154

155155
$this->assertAllTagsWereCovered('posts/test', $assertions);
@@ -191,7 +191,7 @@ public function test_metadata_tags_in_markdown_post_with_flat_front_matter()
191191
'<meta property="og:article:published_time" content="2022-01-01T00:00:00+00:00">',
192192
'<meta property="og:image" content="../media/image.jpg">',
193193
'<meta itemprop="identifier" content="test">',
194-
'<meta itemprop="url" content="http://localhost/posts/test">',
194+
'<meta itemprop="url" content="http://localhost/posts/test.html">',
195195
'<meta itemprop="url" content="../media/image.jpg">',
196196
'<meta itemprop="contentUrl" content="../media/image.jpg">',
197197
]));

0 commit comments

Comments
 (0)