M2: 主题系统(sablog经典+modern简约)+ 前台全部页面 + 老 URL 301 兼容 + markdown 双份导入

This commit is contained in:
ak
2026-08-11 17:58:29 +08:00
parent f16bb75538
commit 6214976a88
66 changed files with 2763 additions and 10 deletions
+32
View File
@@ -0,0 +1,32 @@
{!! $xmlDeclaration !!}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>{{ $siteName }}</title>
<link>{{ url('/') }}</link>
<description>{{ $siteDescription }}</description>
<language>zh-CN</language>
<atom:link href="{{ route('feed.rss') }}" rel="self" type="application/rss+xml"/>
<lastBuildDate>{{ now()->toRssString() }}</lastBuildDate>
@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>
<pubDate>{{ $post->published_at->toRssString() }}</pubDate>
<description>{{ Str::limit(strip_tags($post->excerpt_or_fallback), 300) }}</description>
@if($post->category)
<category>{{ $post->category->name }}</category>
@endif
@foreach($post->tags as $tag)
<category>{{ $tag->name }}</category>
@endforeach
@if($post->author)
<author>{{ $post->author->email }} ({{ $post->author->name }})</author>
@endif
<content:encoded><![CDATA[
{!! app(\App\Blog\Services\PostContentRenderer::class)->render($post) !!}
]]></content:encoded>
</item>
@endforeach
</channel>
</rss>
+26
View File
@@ -0,0 +1,26 @@
{!! $xmlDeclaration !!}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>{{ route('home') }}</loc>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>{{ route('archives') }}</loc>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>{{ route('tags') }}</loc>
<changefreq>weekly</changefreq>
<priority>0.4</priority>
</url>
@foreach($posts as $post)
<url>
<loc>{{ route('posts.show', $post->slug ?: $post->id) }}</loc>
<lastmod>{{ $post->updated_at?->toAtomString() }}</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
@endforeach
</urlset>