Merge branch 'main' of gitea.neatcn.com:gouki/laralog
Keep media-library covers while adopting sablog /show-{id}.shtml canonical URLs.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -75,13 +75,13 @@ class SeoMiddleware
|
||||
'@context' => 'https://schema.org',
|
||||
'@type' => 'BlogPosting',
|
||||
'headline' => $post->title,
|
||||
'url' => route('posts.show', $post->slug ?: $post->id),
|
||||
'url' => route('posts.show', $post->id),
|
||||
'datePublished' => $post->published_at?->toIso8601String(),
|
||||
'dateModified' => $post->updated_at?->toIso8601String(),
|
||||
'author' => ['@type' => 'Person', 'name' => $post->author?->name ?? $siteName] + ($sameAs ? ['sameAs' => $sameAs] : []),
|
||||
'publisher' => ['@type' => 'Organization', 'name' => $siteName, 'url' => url('/')] + ($sameAs ? ['sameAs' => $sameAs] : []),
|
||||
'description' => Str::limit(strip_tags($post->excerpt_or_fallback), 200),
|
||||
'mainEntityOfPage' => route('posts.show', $post->slug ?: $post->id),
|
||||
'mainEntityOfPage' => route('posts.show', $post->id),
|
||||
];
|
||||
|
||||
if ($cover = $post->coverImageUrl()) {
|
||||
@@ -105,7 +105,7 @@ class SeoMiddleware
|
||||
'@type' => 'BreadcrumbList',
|
||||
'itemListElement' => [
|
||||
['@type' => 'ListItem', 'position' => 1, 'name' => $siteName, 'item' => url('/')],
|
||||
['@type' => 'ListItem', 'position' => 2, 'name' => $category->name, 'item' => route('category.show', $category->slug ?: $category->id)],
|
||||
['@type' => 'ListItem', 'position' => 2, 'name' => $category->name, 'item' => route('category.show', $category->id)],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user