liquidRenderer = $liquidRenderer; } public function index() { //模板支持多级目录,需要目录符号 $output = LiquidRenderer::render('collection_list.liquid', [ ]); return response($output); } public function detail($slug) { // 查找对应的 tag $tag = SitePageTag::where('slug', $slug)->first(); if (!$tag) { return response()->json(['message' => '标签未找到'], 404); } // 获取关联的 pages $pages = $tag->pages()->get(); //模板支持多级目录,需要目录符号 $output = LiquidRenderer::render('collection_list.liquid', [ 'tag' => $tag, 'pages' => $pages, ]); return response($output); } }