liquidRenderer = $liquidRenderer; } public function index() { //模板支持多级目录,需要目录符号 $output = LiquidRenderer::render('collection_list.liquid', [ ]); return response($output); } public function detail($slug) { // Find the tag by either slug or id $tag = SitePageTag::where('slug', $slug) ->orWhere('id', $slug) ->where('dist_id',getDistId()) ->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); } }