refactor(routes): canonical URLs now match sablog format exactly
- /show-{id}.shtml (comments page: /show-{id}-{page}.shtml)
- /category-{cid}.shtml / /category-{cid}-{page}.shtml
- /archives-{YYYYMM}.shtml / /archives-{YYYYMM}-{page}.shtml
- /tag/{name}, /tagslist.shtml, /index-{page}.shtml
- slug 时代的 /posts/{slug} 等旧格式全部 301 到 sablog 格式
This commit is contained in:
@@ -110,7 +110,7 @@ class ApiController extends Controller
|
||||
'views' => $post->views,
|
||||
'comment_count' => $post->comment_count,
|
||||
'published_at' => $post->published_at?->toIso8601String(),
|
||||
'url' => route('posts.show', $post->slug ?: $post->id),
|
||||
'url' => route('posts.show', $post->id),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ class ApiController extends Controller
|
||||
'views' => $post->views,
|
||||
'comment_count' => $post->comment_count,
|
||||
'published_at' => $post->published_at?->toIso8601String(),
|
||||
'url' => route('posts.show', $post->slug ?: $post->id),
|
||||
'url' => route('posts.show', $post->id),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user