filled('action')) { return app(LegacyController::class)->resolveAction(request()); } return app(HomeController::class)->index(); })->name('home'); Route::get('/posts/{slug}', [PostController::class, 'show'])->name('posts.show'); Route::post('/posts/{post}/comments', [CommentController::class, 'store'])->name('comments.store'); Route::get('/category/{slug}', [CategoryController::class, 'show'])->name('category.show'); Route::get('/archives', [ArchiveController::class, 'index'])->name('archives'); Route::get('/archives/{year}/{month}', [ArchiveController::class, 'month'])->name('archives.month'); Route::get('/tags', [TagController::class, 'index'])->name('tags'); Route::get('/tags/{slug}', [TagController::class, 'show'])->name('tags.show'); Route::get('/search', [SearchController::class, 'index'])->name('search'); Route::get('/links', [LinkController::class, 'index'])->name('links'); Route::get('/comments', [CommentController::class, 'index'])->name('comments'); Route::get('/login', [AuthController::class, 'showLogin'])->name('login'); Route::post('/login', [AuthController::class, 'login']); Route::post('/logout', [AuthController::class, 'logout'])->name('logout'); Route::get('/register', [AuthController::class, 'showRegister'])->name('register'); Route::post('/register', [AuthController::class, 'register']); Route::get('/profile', [AuthController::class, 'profile'])->middleware('auth')->name('profile'); /* |-------------------------------------------------------------------------- | 稳定路径:RSS / Sitemap / Robots |-------------------------------------------------------------------------- */ Route::get('/rss.xml', [FeedController::class, 'rss'])->name('feed.rss'); Route::get('/rss.php', [FeedController::class, 'rss']); Route::get('/sitemap.xml', [FeedController::class, 'sitemap'])->name('feed.sitemap'); Route::get('/robots.txt', [FeedController::class, 'robots'])->name('robots'); /* |-------------------------------------------------------------------------- | 主题资产(开发模式直接流式返回;生产可用 theme:publish 后由 Web 服务器托管) |-------------------------------------------------------------------------- */ Route::get('/themes/{theme}/assets/{path}', [ThemeAssetController::class, 'show']) ->where('path', '.*') ->name('theme.assets'); /* |-------------------------------------------------------------------------- | sablog 老 URL 兼容(301) |-------------------------------------------------------------------------- */ Route::get('/show-{id}-{page}.html', [LegacyController::class, 'showRewritten']) ->where(['id' => '\d+', 'page' => '\d+']); Route::get('/show-{id}.html', [LegacyController::class, 'showRewritten'])->where('id', '\d+'); Route::get('/category-{cid}-{page}.html', [LegacyController::class, 'categoryRewritten']) ->where(['cid' => '\d+', 'page' => '\d+']); Route::get('/category-{cid}.html', [LegacyController::class, 'categoryRewritten'])->where('cid', '\d+'); Route::get('/archives-{date}-{page}.html', [LegacyController::class, 'archivesRewritten']) ->where(['date' => '\d+', 'page' => '\d+']); Route::get('/archives-{date}.html', [LegacyController::class, 'archivesRewritten'])->where('date', '\d+'); Route::get('/tagslist-{page}.html', fn () => redirect()->route('tags', [], 301))->where('page', '\d+'); Route::get('/tagslist.html', fn () => redirect()->route('tags', [], 301)); Route::get('/comments-{page}.html', fn () => redirect()->route('comments', [], 301))->where('page', '\d+'); Route::get('/comments.shtml', fn () => redirect()->route('comments', [], 301)); Route::get('/search-{page}.html', fn () => redirect()->route('search', [], 301))->where('page', '\d+'); Route::get('/search.shtml', fn () => redirect()->route('search', [], 301)); Route::get('/links.shtml', fn () => redirect()->route('links', [], 301)); Route::get('/reg.shtml', fn () => redirect()->route('register', [], 301)); Route::get('/login.shtml', fn () => redirect()->route('login', [], 301)); Route::get('/tag/{name}', [LegacyController::class, 'tagByName']); Route::get('/index.php', fn () => app(LegacyController::class)->resolveAction(request())); // 旧 PHP 入口 Route::get('/sitemap.php', fn () => redirect()->route('feed.sitemap', [], 301)); Route::get('/attachment.php', [LegacyController::class, 'attachment']); Route::post('/post.php', [LegacyController::class, 'postAction']); Route::get('/tburl.php', fn () => abort(410, 'trackback 已废弃')); Route::get('/trackback.php', fn () => abort(410, 'trackback 已废弃'));