Merge branch 'main' of gitea.neatcn.com:gouki/laralog
Build and Deploy / verify (push) Successful in 34s
Build and Deploy / deploy (push) Successful in 40s

Keep media-library covers while adopting sablog /show-{id}.shtml canonical URLs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
gouki
2026-09-16 19:06:42 +00:00
co-authored by Cursor
23 changed files with 116 additions and 73 deletions
@@ -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)],
],
];
}