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:
@@ -10,8 +10,8 @@
|
||||
@foreach($posts as $post)
|
||||
<item>
|
||||
<title>{{ $post->title }}</title>
|
||||
<link>{{ route('posts.show', $post->slug ?: $post->id) }}</link>
|
||||
<guid isPermaLink="true">{{ route('posts.show', $post->slug ?: $post->id) }}</guid>
|
||||
<link>{{ route('posts.show', $post->id) }}</link>
|
||||
<guid isPermaLink="true">{{ route('posts.show', $post->id) }}</guid>
|
||||
<pubDate>{{ $post->published_at->toRssString() }}</pubDate>
|
||||
<description>{{ Str::limit(strip_tags($post->excerpt_or_fallback), 300) }}</description>
|
||||
@if($post->category)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</url>
|
||||
@foreach($posts as $post)
|
||||
<url>
|
||||
<loc>{{ route('posts.show', $post->slug ?: $post->id) }}</loc>
|
||||
<loc>{{ route('posts.show', $post->id) }}</loc>
|
||||
<lastmod>{{ $post->updated_at?->toAtomString() }}</lastmod>
|
||||
<changefreq>monthly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
|
||||
Reference in New Issue
Block a user